All Products
Search
Document Center

PolarDB:Sysbench tests

Last Updated:Mar 28, 2026

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

SpecificationsNodes
4C32G2
4C32G4
8C64G2
8C64G4

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

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

  1. Set the following parameters. For instructions, see Parameter settings.

    ParameterValue
    ENABLE_COROUTINEtrue
    XPROTO_MAX_DN_CONCURRENT4000
    XPROTO_MAX_DN_WAIT_CONNECTION4000
  2. Connect 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

  1. Download the sysbench.tar.gz package and decompress it:

    tar xzvf sysbench.tar.gz
    cd sysbench/
  2. 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 install

    Verify the installation by running sysbench --version. A successful installation returns sysbench 1.1.0.

  3. Create the configuration file sysb.conf with your PolarDB-X connection details:

    ParameterDescription
    percentilePercentile used to sample response time. Set to 95 for 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'
  4. Import the test data:

    ParameterDescription
    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 to off for 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 run

We 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:

ParameterDescription
db-ps-modeWhether to enable prepared statement mode. Set to disable.
mysql-ignore-errorsMySQL error codes to ignore, such as errors from lock conflicts. Set to all.
range-sizeRange 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 run

oltp_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 run

oltp_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 run

oltp_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 run

oltp_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 run

oltp_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 run

Test 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

Note
  • 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

image
SpecificationsConcurrent threadsQPS
4C32G×21,000201,462.73
4C32G×41,000324,683.03
8C64G×21,000308,174.91
8C64G×42,000635,865.65

Read-only

image
SpecificationsConcurrent threadsQPS
4C32G×260062,446.59
4C32G×41,00094,930.57
8C64G×21,00088,487.24
8C64G×42,000162,330.95

Read-write

image
SpecificationsConcurrent threadsQPS
4C32G×260043,098.16
4C32G×460068,750.24
8C64G×260057,730.62
8C64G×4600111,261.22

Update index

image
SpecificationsConcurrent threadsQPS
4C32G×260049,530.87
4C32G×460086,850.17
8C64G×260065,750.01
8C64G×41,000137,154.16

Update non-index

image
SpecificationsConcurrent threadsQPS
4C32G×240050,627.05
4C32G×41,00090,555.72
8C64G×21,00068,838.02
8C64G×41,000137,071.73

Write-only

image
SpecificationsConcurrent threadsQPS
4C32G×240038,636.02
4C32G×460070,974.3
8C64G×260052,344.94
8C64G×4600101,282.38

MySQL 8.0

Note
  • 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

image
SpecificationsConcurrent threadsQPS
4C32G×21,000166,590.48
4C32G×41,000288,516.53
8C64G×21,000350,510.72
8C64G×42,000637,414.68

Read-only

image
SpecificationsConcurrent threadsQPS
4C32G×260059,770.01
4C32G×41,00071,259.87
8C64G×21,00069,829.69
8C64G×42,000128,366.39

Read-write

image
SpecificationsConcurrent threadsQPS
4C32G×260056,134.05
4C32G×460055,817.45
8C64G×260060,482.86
8C64G×460092,855.15

Update index

image
SpecificationsConcurrent threadsQPS
4C32G×260037,474.15
4C32G×460057,344.42
8C64G×260055,856.94
8C64G×41,00087,618.81

Update non-index

image
SpecificationsConcurrent threadsQPS
4C32G×240038,017.57
4C32G×41,00060,779.25
8C64G×21,00058,065.02
8C64G×41,00091,060.65

Write-only

image
SpecificationsConcurrent threadsQPS
4C32G×240029,476.72
4C32G×460047,558.73
8C64G×260041,032.61
8C64G×460065,794.57