Performance test report

Updated at:

This topic describes the performance test results of the document database (compatible with the MongoDB protocol) of PolarDB for MySQL based on Yahoo! Cloud Serving Benchmark (YCSB), including QPS and latency metrics across scenarios such as data loading, read-only, mixed read/write, and write-only.

Test environment

The following table lists the configurations used in this performance test.

Item

Configuration

PolarDB cluster

The engine is MySQL 8.0.2, the cluster edition series, and the cluster specification is polar.mysql.x8.xlarge (8 vCPUs, 64 GB memory). The storage type is PSL5.

Test client

An Alibaba Cloud ECS instance with the specification ecs.c6e.2xlarge (8 vCPUs, 16 GB memory), deployed in the same VPC as the PolarDB cluster.

Test tool

YCSB (Yahoo! Cloud Serving Benchmark) is used as the benchmark tool for this test. YCSB is a widely used key-value store performance testing framework that supports multiple database engines and can simulate read and write workloads in real-world scenarios.

Each document in the test data model contains 10 fields, with each field being 100 bytes in size. The size of 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 load test data into the database.

Read-only

Read:Write = 100:0

All requests are read operations. This scenario evaluates the 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 the performance under a mixed workload.

Write-only

Read:Write = 0:100

All requests are write operations. This scenario evaluates the throughput and latency in a write-only workload.

Test metrics

The following metrics are used to measure performance in this test.

Metric

Description

QPS

The number of requests processed per second (Queries Per Second). A higher value indicates greater throughput.

RAL (ms)

Read average latency, in milliseconds. A lower value indicates faster read operation response.

WAL (ms)

Write average latency, in milliseconds. A lower value indicates faster write operation response.

Test results

The following table shows the performance test results under different thread counts and scenarios.

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

Note
  • In the read-only scenario, QPS increases nearly linearly with the number of threads, reaching 115,369.5 at 32 threads. Read latency remains stable at 0.27 ms.

  • In the mixed read/write scenario, both read and write latencies remain at low levels, demonstrating balanced overall performance.

  • In the write-only scenario, QPS reaches 25,791.0 at 32 threads, with a write latency of 1.23 ms.

Test command reference

The following are example commands used in the YCSB tests. You can adjust the parameter values as needed.

  1. 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>
  2. 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

mongodb.url

The connection address of the document database. Replace <username>, <password>, <endpoint>, and <port> with the actual account and access address of the document database.

recordcount

The total number of records in the load phase.

operationcount

The total number of operations in the run phase.

readproportion

The proportion of read operations. Set to 100 for the read-only scenario, 0 for the write-only scenario, and 50 for the mixed read/write scenario.

updateproportion

The proportion of write operations. Set to 100 for the write-only scenario, 0 for the read-only scenario, and 50 for the mixed read/write scenario.

threads

The number of concurrent threads. In this test, 16 and 32 threads are used.