Skip to content

Benchmark tool

The Developer SDK includes a benchmark tool for measuring performance and identifying bottlenecks in your configuration.

Build the benchmark tool

Terminal window
# Clone the repository
git clone https://github.com/aerospike/aerospike-client-java-fluent.git
cd 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

Run default benchmarks

Terminal window
java -jar benchmarks/target/aerospike-benchmarks-sdk-0.0.1-jar-with-dependencies.jar \
--hosts localhost:3000 \
--namespace test \
--set benchmark

Default configuration:

  • 100,000 keys
  • 50% reads, 50% writes
  • 1 thread
  • 100 byte values

CLI options reference

Connection options

OptionDescriptionDefault
--hostsComma-separated host:port listlocalhost:3000
--namespaceAerospike namespacetest
--setAerospike set namebenchmark
--userUsername for authentication
--passwordPassword for authentication
--tlsEnable TLSfalse

Workload options

OptionDescriptionDefault
--keysNumber of unique keys100000
--read-pctPercentage of reads (0-100)50
--threadsNumber of client threads1
--durationTest duration in seconds10
--value-sizeValue size in bytes100
--batch-sizeBatch operation size1 (disabled)

Behavior options

OptionDescriptionDefault
--behaviorBehavior presetDEFAULT
--timeoutOperation timeout (ms)from Behavior
--retriesMax retry attemptsfrom Behavior

Example scenarios

Read-heavy workload (90/10)

Simulates cache or session store patterns:

Terminal window
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_FAST

Write-heavy workload (10/90)

Simulates logging or event ingestion:

Terminal window
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 DEFAULT

Batch operations

Test batch read/write performance:

Terminal window
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 60

Large values

Test performance with larger payloads:

Terminal window
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 60

Interpreting latency output

Sample output:

================================================================================
Benchmark Results (60 seconds)
================================================================================
Operations: 1,245,678
Throughput: 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

MetricGood TargetWarning Sign
p50 (median)<1ms>5ms
p99<5ms>20ms
p999<20ms>100ms
Error rate0%>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

  1. Use READ_FAST behavior
  2. Increase connection pool size
  3. Check server memory configuration

If writes are slow

  1. Start with DEFAULT, then tighten durability-related options only when required
  2. Consider async writes for non-critical data
  3. Check server disk I/O

If p99 is high but p50 is good

  1. Check for GC pauses (Java: use -XX:+UseG1GC)
  2. Look for network micro-bursts
  3. Consider connection pooling settings

If throughput plateaus

  1. Increase thread count
  2. Use batch operations
  3. Check server-side bottlenecks

Next steps

Tune Performance

Configure Behaviors for your workload.

Behaviors →

Enable Metrics

Monitor production performance.

Metrics →

Feedback

Was this page helpful?

What type of feedback are you giving?

What would you like us to know?

+Capture screenshot

Can we reach out to you?