The default maximum number of asynchronous connections a client can establish to an Aerospike server node is 300.
When an Aerospike client interacts with a cluster, it manages a pool of connections to each server node. These connections are essential for sending commands (like reads, writes, scans, and queries) and receiving responses. The maximum number of connections typically refers to these client-side limits, which are designed to optimize performance and resource usage.
Understanding Aerospike Client Connection Limits
Aerospike clients provide configurations to control the size of their connection pools. A significant setting in this regard is asyncMaxConnsPerNode
, which specifically defines the limit for asynchronous connections.
- Default Limit: The default value for
asyncMaxConnsPerNode
is 300. This means that by default, an Aerospike client will maintain a pool of no more than 300 asynchronous connections to any single server node within the cluster. - Per Node Application: This limit is applied on a per-node basis. If your Aerospike cluster consists of multiple nodes, the client will independently manage a connection pool to each node, respecting this maximum for every individual node.
- Separate Connection Types: It's important to differentiate between connection types. Aerospike clients track and manage synchronous and asynchronous connections separately. The
asyncMaxConnsPerNode
specifically pertains to asynchronous connections.
Factors Influencing Connection Pool Usage
The actual number of connections actively used from the client's pool to a server node at any given moment is dynamic and depends on the workload:
- Concurrent Commands: The more concurrent operations (e.g., read, write, operate) your application initiates, the more connections will be drawn from the pool. Each active command typically holds a connection until its completion.
- Parallel Multi-Node Operations: Operations that inherently involve multiple server nodes, such as batch reads, scans, or queries, generate "sub-commands." These sub-commands fan out to relevant nodes and also consume connections, potentially increasing the demand on the connection pool to individual nodes. For example, a large batch read distributed across several nodes will require multiple connections simultaneously across different server nodes.
Best Practices for Connection Management
Optimizing client connection settings is crucial for achieving high performance and ensuring the stability of your Aerospike application:
- Adequate Pooling: Configure client connection limits (
asyncMaxConnsPerNode
and potentially synchronous limits) to be sufficient for your application's peak concurrency requirements. Insufficient connections can lead to command queuing and increased latency. - Resource Considerations: While increasing connection limits allows for more concurrency, setting them excessively high can consume significant system resources (like memory and file descriptors) on both the client and server side.
- Monitoring and Tuning: Continuously monitor client-side metrics such as connection pool utilization, command throughput, and latency. Use this data to fine-tune your connection limits to match your application's specific workload patterns.
Key Connection Information
Feature | Description |
---|---|
Default asyncMaxConnsPerNode |
300 asynchronous connections. |
Scope of Limit | Applies on a per-server-node basis from the client's perspective. |
Connection Type Tracking | Asynchronous and synchronous connections are managed independently by the client. |
Factors for Usage | Dependent on the number of concurrent commands in progress and sub-commands generated by parallel multi-node operations (e.g., batch, scan, query). |
Configurability | This is a configurable client-side setting that can be adjusted from its default value based on specific application needs and server capacity. |
By effectively managing client connection pools, you can ensure your Aerospike application operates efficiently, delivering high throughput and low latency.