Performance test report
This topic presents performance test results for the PolarDB for MySQL document database (compatible with the MongoDB protocol). The tests are based on Yahoo! Cloud Serving Benchmark (YCSB) and cover QPS and latency metrics in load, read-only, read/write mix, and write-only scenarios.
Test environment
The following table describes the environment configuration used for this performance test.
|
Item |
Configuration |
|
PolarDB cluster |
The engine is MySQL 8.0.2 in the Cluster Edition series. The cluster specification is |
|
Test client |
An Alibaba Cloud ECS instance with the specification |
Test tool
This test uses YCSB (Yahoo! Cloud Serving Benchmark) as the benchmark tool. YCSB is a widely used performance testing framework for key-value stores. It supports multiple database engines and can simulate read and write workloads in real-world scenarios.
The test data model contains 10 fields per document, and each field is 100 bytes. A single document is approximately 1 KB.
Performance tests
Test scenarios
This performance test covers the following four scenarios.
|
Scenario |
Read/write ratio |
Description |
|
Load |
Write-only |
Bulk loads the test data into the database. |
|
Read-only |
Read:write = 100:0 |
All requests are read operations. This scenario evaluates throughput and latency in a read-only workload. |
|
Read/write mix |
Read:write = 50:50 |
Read and write operations each account for 50%. This scenario evaluates performance under a mixed workload. |
|
Write-only |
Read:write = 0:100 |
All requests are write operations. This scenario evaluates throughput and latency in a write-only workload. |
Test metrics
This test uses the following metrics to measure performance.
|
Metric |
Description |
|
QPS |
The number of requests processed per second (Queries Per Second). A higher value indicates greater throughput. |
|
RAL (ms) |
The average latency of read operations (Read Average Latency), in milliseconds. A lower value indicates a faster read response. |
|
WAL (ms) |
The average latency of write operations (Write Average Latency), in milliseconds. A lower value indicates a faster write response. |
Test results
The following table shows the performance test results for different thread counts and scenarios.
|
Test scenario |
Threads |
QPS |
RAL (ms) |
WAL (ms) |
|
Load |
32 |
21,020.8 |
- |
1.94 |
|
Read-only (r:w=100:0) |
16 |
56,722.7 |
0.27 |
- |
|
32 |
115,369.5 |
0.27 |
- |
|
|
Read/write mix (r:w=50:50) |
16 |
29,225.7 |
0.32 |
0.76 |
|
32 |
41,533.0 |
0.39 |
1.14 |
|
|
Write-only (r:w=0:100) |
16 |
18,455.8 |
- |
0.86 |
|
32 |
25,791.0 |
- |
1.23 |
-
In the read-only scenario, QPS increases nearly linearly as the number of threads increases, reaching 115,369.5 QPS at 32 threads. Read latency remains stable at 0.27 ms.
-
In the read/write mix scenario, both read and write latency remain low, and overall performance is balanced.
-
In the write-only scenario, QPS reaches 25,791.0 at 32 threads, and write latency is 1.23 ms.
Test command reference
The following are command examples used in the YCSB tests. Adjust the parameter values as needed.
-
Load data
./bin/ycsb load mongodb -s \ -p workload=site.ycsb.workloads.CoreWorkload \ -p recordcount=10000000 \ -p mongodb.url="mongodb://<user>:<password>@<endpoint>:<port>/<db>" \ -p core_workload_insertion_retry_limit=3 \ -threads <thread_count> -
Run tests
./bin/ycsb run mongodb -s \ -p workload=site.ycsb.workloads.CoreWorkload \ -p recordcount=10000000 \ -p operationcount=10000000 \ -p insertproportion=0 \ -p readproportion=<read_ratio> \ -p updateproportion=<write_ratio> \ -p mongodb.url="mongodb://<user>:<password>@<endpoint>:<port>/<db>" \ -threads <thread_count>
The following table describes the parameters in the test commands.
|
Parameter |
Description |
|
|
The connection string of the document database. Replace |
|
|
The total number of records in the load phase. |
|
|
The total number of operations in the stress test phase. |
|
|
The proportion of read operations. Set this parameter to 100 for the read-only scenario, 0 for the write-only scenario, and 50 for the read/write mix scenario. |
|
|
The proportion of write operations. Set this parameter to 100 for the write-only scenario, 0 for the read-only scenario, and 50 for the read/write mix scenario. |
|
|
The number of concurrent threads. This test uses 16 and 32 threads. |