Skip to main content


Use the Aerospike Node.js client benchmark tool to apply load and test your configuration.

The benchmark tool is a collection of example programs that provide an end-to-end example of a more complex Aerospike Node.js program.


To use the benchmark tool, install the aerospike module in the benchmarks directory.

From the benchmarks directory, run the following to install the dependencies:

npm install ../
npm update

Running the main Benchmark

main.js runs multiple batches of operations against an Aerospike cluster. It can run for a specified number of iterations or time frame.

To run main.js:

node main.js

The configuration parameters to run this benchmark are specified in config.json. A sample config.json is in the benchmarks directory. Modify the following parameters in config.json to run your desired configuration:

  • host The Aerospike host node (default = localhost).
  • port The port to use to connect to the Aerospike server (default = 3000).
  • namespace All the operations for benchmark are done on this namespace (default = test).
  • set The set name where all benchmark operations are performed (default = demo).
  • user The username to use to connect with the secured cluster (default = null).
  • password The password for the user connecting to the secured cluster (default = null).
  • timeout The global timeout for all read/write operations used in the benchmark (default = 0; never timeout).
  • ttl The time-to-live value for objects written during the benchmark (default 10000 seconds).
  • log The log level of the client module (default = INFO).
  • operations The number of operations for a single batch of operations (default = 100).
  • iterations The number of iterations for the benchmark to run (default = null; runs indefinitely).
  • processes The number of worker processes. These perform the actual read/write or scan/query operations in the Aerospike cluster (default = 4; recommended value is the number of CPUs/cores available).
  • time The time to run the benchmark, specified in seconds/minutes/hours (for example, 30s/30m/30h runs for the benchmark for 30 seconds/30 minutes/30 hours, respectively (default = 24h; run for 24 hours).
  • reads The read proportion of the read/write ratio (default = 1).
  • writes The write proportion of the read/write ratio. (default 1).
  • keyrange The range of key values to use in the benchmark for read/write operations (default = 0-100000).
  • binSpec The bin specification for write operations in benchmark, specified using
    • name The bin name.
    • type The bin type (STRING, BYTES, or INTEGER).
    • size The size of data to write to each bin (for integer type bins, the default size is 8).

Benchmark Output

The benchmark prints the read/write tps in the following format:

info: Fri Oct 02 2015 00:03:55 GMT+0530 (IST) read(tps=14434 timeouts=0 errors=0) write(tps=14350 timeouts=0 errors=0)

info: Fri Oct 02 2015 00:03:56 GMT+0530 (IST) read(tps=14009 timeouts=0 errors=0) write(tps=14119 timeouts=0 errors=0)

info: Fri Oct 02 2015 00:03:57 GMT+0530 (IST) read(tps=14691 timeouts=0 errors=0) write(tps=14581 timeouts=0 errors=0)

info: Fri Oct 02 2015 00:03:58 GMT+0530 (IST) read(tps=14200 timeouts=0 errors=0) write(tps=14200 timeouts=0 errors=0)

It then prints the benchmark run summary in the following format:


  • Configuration

  • operations : 100

  • iterations : undefined

  • processes : 4

  • time : 30 seconds

  • Durations (milliseconds) : latency histogram of read/write operations.

  • Status Codes : histogram for return values of read/write operations.