BatchPolicymaxConcurrentThreads Field

Maximum number of concurrent synchronous batch node request threads to server nodes. Asynchronous batch requests ignore this field and always issue all node requests in parallel.

The batch is split into requests for each node according to the node assignment of each batch key. The number of batch node requests is always less or equal to the cluster size.

If there are 16 batch node requests and maxConcurrentThreads is 8, then batch requests will be made for 8 nodes in parallel threads. When a request completes, a new request will be issued until all 16 requests are complete. If there are 4 batch node requests and maxConcurrentThreads is 8, then only 4 batch requests will be made for 4 nodes in parallel threads.

Values:

  • 1 (default): Issue batch node requests sequentially. This mode has a performance advantage for small batch sizes because requests can be issued in the main transaction thread without using a thread pool. This mode is not optimal for batch requests spread out over many nodes in a large cluster.
  • 0: Issue all batch node requests in parallel threads. This mode has a performance advantage for large batch sizes because each node can process the request immediately. The downside is extra threads will need to be created (or taken from a thread pool). In extreme cases, the operating system's thread capacity could be exhausted.
  • > 0: Issue up to maxConcurrentThreads batch node requests in parallel threads. When a request completes, a new request will be issued until all requests are complete. This mode prevents too many parallel threads being created for large clusters. The downside is extra threads will still need to be created (or taken from a thread pool). A typical value is the number of cpu cores available on the client machine.

Default: 1

Definition

Namespace: Aerospike.Client
Assembly: AerospikeClient (in AerospikeClient.dll) Version: 7.0.1
C#
public int maxConcurrentThreads

Field Value

Int32

See Also