Benchmark tool
The Developer SDK includes a benchmark tool for measuring performance and identifying bottlenecks in your configuration.
Build the benchmark tool
# Clone the repositorygit clone https://github.com/aerospike/aerospike-client-java-fluent.gitcd aerospike-client-java-fluent
# Build the benchmark tool (fat JAR with dependencies)mvn -pl benchmarks package -DskipTests
# The runnable JAR is benchmarks/target/aerospike-benchmarks-sdk-0.0.1-jar-with-dependencies.jar# Install from PyPIpip install aerospike-sdk
# Or clone and install from sourcegit clone https://github.com/aerospike/aerospike-client-python-sdk.gitcd aerospike-client-python-sdkpip install -e .Run default benchmarks
java -jar benchmarks/target/aerospike-benchmarks-sdk-0.0.1-jar-with-dependencies.jar \ --hosts localhost:3000 \ --namespace test \ --set benchmarkDefault configuration:
- 100,000 keys
- 50% reads, 50% writes
- 1 thread
- 100 byte values
aerospike-sdk-benchmark \ --hosts localhost:3000 \ --namespace test \ --set benchmarkDefault configuration:
- 100,000 keys
- 50% reads, 50% writes
- 1 thread
- 100 byte values
CLI options reference
Connection options
| Option | Description | Default |
|---|---|---|
--hosts | Comma-separated host:port list | localhost:3000 |
--namespace | Aerospike namespace | test |
--set | Aerospike set name | benchmark |
--user | Username for authentication | — |
--password | Password for authentication | — |
--tls | Enable TLS | false |
Workload options
| Option | Description | Default |
|---|---|---|
--keys | Number of unique keys | 100000 |
--read-pct | Percentage of reads (0-100) | 50 |
--threads | Number of client threads | 1 |
--duration | Test duration in seconds | 10 |
--value-size | Value size in bytes | 100 |
--batch-size | Batch operation size | 1 (disabled) |
Behavior options
| Option | Description | Default |
|---|---|---|
--behavior | Behavior preset | DEFAULT |
--timeout | Operation timeout (ms) | from Behavior |
--retries | Max retry attempts | from Behavior |
Example scenarios
Read-heavy workload (90/10)
Simulates cache or session store patterns:
java -jar benchmarks/target/aerospike-benchmarks-sdk-0.0.1-jar-with-dependencies.jar \ --hosts localhost:3000 \ --namespace test \ --keys 1000000 \ --read-pct 90 \ --threads 16 \ --duration 60 \ --behavior READ_FASTaerospike-sdk-benchmark \ --hosts localhost:3000 \ --namespace test \ --keys 1000000 \ --read-pct 90 \ --threads 16 \ --duration 60 \ --behavior READ_FASTWrite-heavy workload (10/90)
Simulates logging or event ingestion:
java -jar benchmarks/target/aerospike-benchmarks-sdk-0.0.1-jar-with-dependencies.jar \ --hosts localhost:3000 \ --namespace test \ --keys 1000000 \ --read-pct 10 \ --threads 32 \ --duration 60 \ --behavior DEFAULTaerospike-sdk-benchmark \ --hosts localhost:3000 \ --namespace test \ --keys 1000000 \ --read-pct 10 \ --threads 32 \ --duration 60 \ --behavior DEFAULTBatch operations
Test batch read/write performance:
java -jar benchmarks/target/aerospike-benchmarks-sdk-0.0.1-jar-with-dependencies.jar \ --hosts localhost:3000 \ --namespace test \ --keys 100000 \ --batch-size 100 \ --threads 8 \ --duration 60aerospike-sdk-benchmark \ --hosts localhost:3000 \ --namespace test \ --keys 100000 \ --batch-size 100 \ --threads 8 \ --duration 60Large values
Test performance with larger payloads:
java -jar benchmarks/target/aerospike-benchmarks-sdk-0.0.1-jar-with-dependencies.jar \ --hosts localhost:3000 \ --namespace test \ --keys 10000 \ --value-size 10240 \ --threads 4 \ --duration 60aerospike-sdk-benchmark \ --hosts localhost:3000 \ --namespace test \ --keys 10000 \ --value-size 10240 \ --threads 4 \ --duration 60Interpreting latency output
Sample output:
================================================================================Benchmark Results (60 seconds)================================================================================Operations: 1,245,678Throughput: 20,761 ops/sec
Latency (microseconds): min avg p50 p95 p99 p999 max read 45 125 110 245 512 1,245 8,432 write 52 185 165 385 845 2,156 12,567
Errors: 0 (0.00%)================================================================================Key metrics
| Metric | Good Target | Warning Sign |
|---|---|---|
| p50 (median) | <1ms | >5ms |
| p99 | <5ms | >20ms |
| p999 | <20ms | >100ms |
| Error rate | 0% | >0.1% |
Interpreting results
- High p99/p999: Indicates occasional slow operations—check GC (Java), network, or server load
- High error rate: Check server logs, connection limits, or timeout settings
- Low throughput: Increase threads, check batch sizes, or verify network bandwidth
Tuning based on results
If reads are slow
- Use
READ_FASTbehavior - Increase connection pool size
- Check server memory configuration
If writes are slow
- Start with
DEFAULT, then tighten durability-related options only when required - Consider async writes for non-critical data
- Check server disk I/O
If p99 is high but p50 is good
- Check for GC pauses (Java: use
-XX:+UseG1GC) - Look for network micro-bursts
- Consider connection pooling settings
If throughput plateaus
- Increase thread count
- Use batch operations
- Check server-side bottlenecks
Next steps
Tune Performance
Configure Behaviors for your workload.
Enable Metrics
Monitor production performance.