SystemSettings¶
- class aerospike_sdk.policy.system_settings.SystemSettings[source]¶
Bases:
objectCluster-wide settings that apply to an entire cluster instance.
These settings cannot vary per Behavior – they are inherently global to the connection pool and cluster maintenance.
Settings may also come from an SDK configuration file (the
AEROSPIKE_SDK_CONFIG_URLenvironment variable). File-provided values take precedence over values set here, field by field: a field the file does not provide falls through to this object, then to the hard default.Example:
settings = SystemSettings( max_connections_per_node=200, max_socket_idle_time=timedelta(seconds=30), ) cluster = await ( ClusterDefinition("localhost", 3000) .with_system_settings(settings) .connect() )
wait_for_connection_to_completebounds how long the pool may spend establishing one connection (TCP connect, TLS, authentication). It lives here rather than on a Behavior because the pool does the connecting and the pool is client-scoped: commands never open connections inline, so there is no per-operation moment for a connect bound to govern. Unset, it falls back to the client policy’s total timeout.tend_timeoutbounds each cluster-tend info call, the first contact with a seed included;login_timeoutbounds the login exchange on every new connection when the cluster has security enabled. Both are client-wide for the same reason, so they live here rather than on the cluster definition. Unset, the hard defaults are one second and five seconds. Neither has a key in the configuration file.Connection-pool sizing is the group most worth setting explicitly. Left unset, the hard defaults are
min_connections_per_node=0,max_connections_per_node=256, andconn_pools_per_node=1. The maximum is a fail-fast cap rather than a queue, so a client whose concurrency outgrows it becomes pool-bound – throughput flattens and latency climbs while the cluster still has headroom. Size it to total client concurrency, not to concurrency divided by node count, since bursts do not spread evenly across nodes.See also
TransactionSettings: The SDK-runtime transaction group.with_system_settings()- transactions: TransactionSettings = TransactionSettings(implicit_batch_write_transactions=None, sleep_between_attempts=None, number_of_attempts=None)¶
- metrics: MetricsSettings = MetricsSettings(enabled=None, latency_unit=None, latency_columns=None, latency_shift=None, export_interval=None, exporter=None, report_dir=None, report_size_limit=None, sampler_range=None, sampler_threshold=None, labels=None, operational_enabled=None, usage_enabled=None)¶
- apply_to(policy)[source]¶
Apply non-None fields to policy, returning the same object.
The
transactionsgroup is SDK-runtime configuration and is deliberately not applied; it is read at operation time.- Return type:
ClientPolicy
- __init__(*, min_connections_per_node=None, max_connections_per_node=None, conn_pools_per_node=None, wait_for_connection_to_complete=None, tend_timeout=None, login_timeout=None, max_socket_idle_time=None, tend_interval=None, num_tend_intervals_in_error_window=None, max_errors_in_error_window=None, transactions=TransactionSettings(implicit_batch_write_transactions=None, sleep_between_attempts=None, number_of_attempts=None), metrics=MetricsSettings(enabled=None, latency_unit=None, latency_columns=None, latency_shift=None, export_interval=None, exporter=None, report_dir=None, report_size_limit=None, sampler_range=None, sampler_threshold=None, labels=None, operational_enabled=None, usage_enabled=None))¶
TransactionSettings¶
- class aerospike_sdk.policy.system_settings.TransactionSettings[source]¶
Bases:
objectSDK-runtime transaction behavior, read at operation time.
Unlike the connection and refresh groups on
SystemSettings, these fields do not map ontoClientPolicy; they configure how the SDK itself drives multi-record transactions.Nonemeans “not set” — the value falls through to the next configuration layer (seeSystemSettingsfor layering), ending at the hard defaults:implicit_batch_write_transactionsTrue,number_of_attempts10,sleep_between_attempts20 ms.implicit_batch_write_transactionscontrols whether a multi-key write batch on a strong-consistency namespace (MRT-capable cluster, no explicit transaction active) is wrapped in an implicit multi-record transaction so its writes commit atomically.number_of_attemptsandsleep_between_attemptsdrive the retry loop for those implicit transactions, and fordo_in_transaction(), when an attempt ends in a transient conflict.number_of_attemptscounts the first try. A version mismatch retries immediately; a blocked record or failed commit sleepssleep_between_attempts+/- 50% (jittered, so the mean is unchanged) first.Example:
settings = SystemSettings( transactions=TransactionSettings( implicit_batch_write_transactions=False, ), ) cluster = await ( ClusterDefinition("localhost", 3000) .with_system_settings(settings) .connect() )
See also
SystemSettings: Carrier for these settings.- __init__(*, implicit_batch_write_transactions=None, sleep_between_attempts=None, number_of_attempts=None)¶