This document covers the test environment, setup procedure, and QPS results for Sysbench benchmarks run against PolarDB-X with MySQL 5.7 and MySQL 8.0 engines. Use these results to evaluate whether PolarDB-X meets your OLTP throughput requirements, or follow the procedure to reproduce the tests in your own environment.
Prerequisites
Before you begin, make sure you have:
An Alibaba Cloud account with permissions to create ECS and PolarDB-X instances
Access to a virtual private cloud (VPC) where you can deploy all instances
Test environment
Test dataset
Tables: 16
Rows per table: 10,000,000
Instance specifications
| Specifications | Nodes |
|---|---|
| 4C32G | 2 |
| 4C32G | 4 |
| 8C64G | 2 |
| 8C64G | 4 |
Stress testing machine
ecs.g7ne.8xlarge (32 vCPUs, 128 GB memory)
Set up the test environment
Step 1: Create an ECS instance
Create an Elastic Compute Service (ECS) instance to host the stress testing tool. To avoid performance bottlenecks when testing high-spec PolarDB-X instances, use an instance with 32 vCPUs and 128 GB of memory.
Deploy the ECS instance in a VPC. Record the VPC name and ID — all database instances created in subsequent steps must reside in the same VPC.
Step 2: Create a PolarDB-X instance
Create a PolarDB-X instance. Select the MySQL 5.7 or MySQL 8.0 engine based on your requirements. For instructions, see Create a PolarDB-X instance.
The PolarDB-X instance and the ECS instance must reside in the same VPC.
Create a database named
sbtest. For instructions, see Create a database.CREATE DATABASE sbtest;
Step 3: Configure instance parameters
Modify the compute node parameters to achieve optimal performance during stress testing.
Set the following parameters. For instructions, see Parameter settings.
Parameter Value ENABLE_COROUTINEtrueXPROTO_MAX_DN_CONCURRENT4000XPROTO_MAX_DN_WAIT_CONNECTION4000Connect to the PolarDB-X instance using a command-line client, then run the following SQL statements in the same session to disable logging and CPU statistical sampling:
set global RECORD_SQL=false; set global MPP_METRIC_LEVEL=0; set global ENABLE_CPU_PROFILE=false; set global ENABLE_TRANS_LOG=false;
Step 4: Install Sysbench and prepare data
Download the sysbench.tar.gz package and decompress it:
tar xzvf sysbench.tar.gz cd sysbench/Install and compile dependencies:
You can also download Sysbench directly from GitHub.
yum -y install make automake libtool pkgconfig libaio-devel mysql-devel ./autogen.sh ./configure make -j make installVerify the installation by running
sysbench --version. A successful installation returnssysbench 1.1.0.Create the configuration file
sysb.confwith your PolarDB-X connection details:Parameter Description percentilePercentile used to sample response time. Set to 95for 95th-percentile latency.histogramWhether to display a response time distribution histogram. report-intervalInterval at which real-time results are displayed, in seconds. timeDuration of the stress test, in seconds. rand-typeDistribution type for random number generation. mysql-host='<HOST>' mysql-port='<PORT>' mysql-user='<USER>' mysql-password='<PASSWORD>' mysql-db='sbtest' db-driver='mysql' percentile='95' histogram='on' report-interval='1' time='60' rand-type='uniform'Import the test data:
Parameter Description config-filePath to the common configuration file. create-table-optionsTable creation mode. Uses PolarDB-X dbpartition by hash(id)syntax.tablesNumber of tables to create. table-sizeNumber of rows per table. threadsNumber of concurrent threads for data import. auto_incWhether to use AUTO_INCREMENT. Set toofffor this test.sysbench --config-file='sysb.conf' \ --create-table-options='dbpartition by hash(id)' \ --tables='16' \ --table-size='10000000' \ --threads='16' \ --auto_inc='off' \ oltp_point_select prepare
Step 5: Warm up the buffer cache
Before collecting results, run a warm-up pass to load data from disk into memory. Skipping this step causes the first run to produce lower QPS due to cold-cache reads.
sysbench --config-file='sysb.conf' \
--db-ps-mode='disable' \
--mysql-ignore-errors='all' \
--tables='16' \
--table-size='10000000' \
--threads=<threads> \
oltp_point_select runWe recommend that you increase the duration of this first run to allow the cache to stabilize before you collect benchmark results.
Step 6: Run the stress tests
Run the following commands to test each of the six Sysbench OLTP workloads. Replace <threads> with the number of concurrent threads.
The parameters used in all run commands:
| Parameter | Description |
|---|---|
db-ps-mode | Whether to enable prepared statement mode. Set to disable. |
mysql-ignore-errors | MySQL error codes to ignore, such as errors from lock conflicts. Set to all. |
range-size | Range size for range queries (applies to oltp_read_only and oltp_read_write). Set to 5. |
oltp_point_select
sysbench --config-file='sysb.conf' \
--db-ps-mode='disable' \
--mysql-ignore-errors='all' \
--tables='16' \
--table-size='10000000' \
--threads=<threads> \
oltp_point_select runoltp_read_only
sysbench --config-file='sysb.conf' \
--db-ps-mode='disable' \
--mysql-ignore-errors='all' \
--tables='16' \
--table-size='10000000' \
--range-size=5 \
--threads=<threads> \
oltp_read_only runoltp_read_write
sysbench --config-file='sysb.conf' \
--db-ps-mode='disable' \
--mysql-ignore-errors='all' \
--tables='16' \
--table-size='10000000' \
--range-size=5 \
--threads=<threads> \
oltp_read_write runoltp_update_index
sysbench --config-file='sysb.conf' \
--db-ps-mode='disable' \
--mysql-ignore-errors='all' \
--tables='16' \
--table-size='10000000' \
--threads=<threads> \
oltp_update_index runoltp_update_non_index
sysbench --config-file='sysb.conf' \
--db-ps-mode='disable' \
--mysql-ignore-errors='all' \
--tables='16' \
--table-size='10000000' \
--threads=<threads> \
oltp_update_non_index runoltp_write_only
sysbench --config-file='sysb.conf' \
--db-ps-mode='disable' \
--mysql-ignore-errors='all' \
--tables='16' \
--table-size='10000000' \
--threads=<threads> \
oltp_write_only runTest results
Results are measured in QPS (queries per second). Each result row shows the thread count at which peak QPS was observed for that configuration.
MySQL 5.7
PolarDB-X version:
polardb-2.4.0_5.4.19-20240610_xcluster5.4.19-20240527. For details, see Release notes.In the following test results, QPS values are used to measure the database performance.
Point select

| Specifications | Concurrent threads | QPS |
|---|---|---|
| 4C32G×2 | 1,000 | 201,462.73 |
| 4C32G×4 | 1,000 | 324,683.03 |
| 8C64G×2 | 1,000 | 308,174.91 |
| 8C64G×4 | 2,000 | 635,865.65 |
Read-only

| Specifications | Concurrent threads | QPS |
|---|---|---|
| 4C32G×2 | 600 | 62,446.59 |
| 4C32G×4 | 1,000 | 94,930.57 |
| 8C64G×2 | 1,000 | 88,487.24 |
| 8C64G×4 | 2,000 | 162,330.95 |
Read-write

| Specifications | Concurrent threads | QPS |
|---|---|---|
| 4C32G×2 | 600 | 43,098.16 |
| 4C32G×4 | 600 | 68,750.24 |
| 8C64G×2 | 600 | 57,730.62 |
| 8C64G×4 | 600 | 111,261.22 |
Update index

| Specifications | Concurrent threads | QPS |
|---|---|---|
| 4C32G×2 | 600 | 49,530.87 |
| 4C32G×4 | 600 | 86,850.17 |
| 8C64G×2 | 600 | 65,750.01 |
| 8C64G×4 | 1,000 | 137,154.16 |
Update non-index

| Specifications | Concurrent threads | QPS |
|---|---|---|
| 4C32G×2 | 400 | 50,627.05 |
| 4C32G×4 | 1,000 | 90,555.72 |
| 8C64G×2 | 1,000 | 68,838.02 |
| 8C64G×4 | 1,000 | 137,071.73 |
Write-only

| Specifications | Concurrent threads | QPS |
|---|---|---|
| 4C32G×2 | 400 | 38,636.02 |
| 4C32G×4 | 600 | 70,974.3 |
| 8C64G×2 | 600 | 52,344.94 |
| 8C64G×4 | 600 | 101,282.38 |
MySQL 8.0
PolarDB-X version:
polardb-2.4.0_5.4.19-20240610_xcluster8.4.19-20240523. For details, see Release notes.In the following test results, QPS values are used to measure the database performance.
Point select

| Specifications | Concurrent threads | QPS |
|---|---|---|
| 4C32G×2 | 1,000 | 166,590.48 |
| 4C32G×4 | 1,000 | 288,516.53 |
| 8C64G×2 | 1,000 | 350,510.72 |
| 8C64G×4 | 2,000 | 637,414.68 |
Read-only

| Specifications | Concurrent threads | QPS |
|---|---|---|
| 4C32G×2 | 600 | 59,770.01 |
| 4C32G×4 | 1,000 | 71,259.87 |
| 8C64G×2 | 1,000 | 69,829.69 |
| 8C64G×4 | 2,000 | 128,366.39 |
Read-write

| Specifications | Concurrent threads | QPS |
|---|---|---|
| 4C32G×2 | 600 | 56,134.05 |
| 4C32G×4 | 600 | 55,817.45 |
| 8C64G×2 | 600 | 60,482.86 |
| 8C64G×4 | 600 | 92,855.15 |
Update index

| Specifications | Concurrent threads | QPS |
|---|---|---|
| 4C32G×2 | 600 | 37,474.15 |
| 4C32G×4 | 600 | 57,344.42 |
| 8C64G×2 | 600 | 55,856.94 |
| 8C64G×4 | 1,000 | 87,618.81 |
Update non-index

| Specifications | Concurrent threads | QPS |
|---|---|---|
| 4C32G×2 | 400 | 38,017.57 |
| 4C32G×4 | 1,000 | 60,779.25 |
| 8C64G×2 | 1,000 | 58,065.02 |
| 8C64G×4 | 1,000 | 91,060.65 |
Write-only

| Specifications | Concurrent threads | QPS |
|---|---|---|
| 4C32G×2 | 400 | 29,476.72 |
| 4C32G×4 | 600 | 47,558.73 |
| 8C64G×2 | 600 | 41,032.61 |
| 8C64G×4 | 600 | 65,794.57 |