docs/content/v2.20/benchmark/key-value-workload-ycql.md
{{<api-tabs list="ycql">}}
Use this benchmark to test the performance of YugabyteDB using a key-value workload.
For this benchmark, you will set up a three-node YugabyteDB cluster with a replication factor of 3.
Amazon Web Services (AWS)
Google Cloud Platform (GCP)
on-premises data center
We will use the YugabyteDB Workload Generator to perform this benchmark.
Download the YugabyteDB workload generator JAR file (yb-sample-apps.jar) as follows:
{{% yb-sample-apps-path %}}
To run the workload generator tool, you must have:
ENDPOINTS="X.X.X.X:9042,X.X.X.X:9042,X.X.X.X:9042"
Run the key-value workload with higher number of write threads (representing write-heavy workload).
Load 1B keys of 256 bytes each across 256 writer threads
$ java -jar ./yb-sample-apps.jar \
--workload CassandraKeyValue \
--nodes $ENDPOINTS \
--nouuid \
--value_size 256 \
--num_threads_read 0 \
--num_threads_write 256 \
--num_unique_keys 1000000000
| Name | Observation |
|---|---|
| Write Ops/sec | ~90k |
| Write Latency | ~2.5-3.0 ms/op |
| CPU (User + Sys) | 60% |
Run the key-value workload with higher number of read threads (representing read-heavy workload).
Load 1M keys of 256 bytes and access them with 256 reader threads.
$ java -jar ./yb-sample-apps.jar \
--workload CassandraKeyValue \
--nodes $ENDPOINTS \
--nouuid \
--value_size 256 \
--num_threads_read 256 \
--num_threads_write 0 \
--num_unique_keys 1000000
| Name | Observation |
|---|---|
| (Read) Ops/sec | ~150k |
| (Read) Latency | ~1.66 ms/op |
| CPU (User + Sys) | 60% |
Run the key-value workload in batch mode and higher number of write threads (representing batched, write-heavy workload).
Load 1B keys of 256 bytes each across 64 writer threads in batches of 25 each.
$ java -jar ./yb-sample-apps.jar \
--workload CassandraBatchKeyValue \
--nodes $ENDPOINTS \
--nouuid \
--batch_size 25 \
--value_size 256 \
--num_threads_read 0 \
--num_threads_write 64 \
--num_unique_keys 1000000000
| Name | Observation |
|---|---|
| (Batch Write) Ops/sec | ~140k |
| (Batch Write) Latency | ~9.0 ms/op |
| CPU (User + Sys) | 80% |