tencent cloud

TencentDB for MySQL

Testing Tool

Download
Focus Mode
Font Size
Last updated: 2026-10-12 14:33:58
AI-Translated
This document describes SysBench, a performance testing tool for TencentDB for MySQL, and how to install SysBench on a CVM instance.

Introduction to SysBench

SysBench is a cross-platform, multi-threaded, and modular benchmark tool used to evaluate the performance of key system parameters when high-load databases are being run. It can bypass complex database benchmark setup and quickly provide insights into database system performance, even without a database installed.

SysBench Test Model

In the SysBench standard OLTP read-write mixed scenario, a transaction contains 18 read-write SQL statements.
In the SysBench standard OLTP read-only scenario, a transaction contains 14 read SQL statements (10 primary key point queries and 4 range queries).
In the SysBench standard OLTP write-only scenario, a transaction contains 4 write SQL statements (2 UPDATE, 1 DELETE, and 1 INSERT).

SysBench Parameter Description

Parameter
Description
db-driver
Database Engine
mysql-host
MySQL instance connection address
mysql-port
MySQL instance connection port
mysql-user
MySQL instance account
mysql-password
Password for the MySQL instance account
mysql-db
MySQL instance database name
table_size
Table Size
tables
Number of Tables
events
Number of Test Requests
time
Test Time
threads
Number of Test Threads
percentile
The percentage to be counted. The default value is 95%, which indicates the execution time of requests in 95% of cases.
report-interval
Indicates that a test progress report is output every N seconds. A value of 0 disables the output of test progress reports and outputs only the final report result.
skip-trx
Whether to skip a transaction.
1: Skip
0: Do not skip

Installation Method

This stress test uses SysBench 1.0.20. For more information, see SysBench official documentation.
1. Run the following command on the CVM instance to install SysBench.
yum install gcc gcc-c++ autoconf automake make libtool bzr mysql-devel git mysql
git clone https://github.com/akopytov/sysbench.git
##Download SysBench from Git.
cd sysbench
##Open the SysBench directory.
git checkout 1.0.20
##Switch to SysBench 1.0.20.
./autogen.sh
##Run autogen.sh.
./configure --prefix=/usr --mandir=/usr/share/man
make
##Compile.
make install
2. Run the following commands to configure the client to enable the kernel to use all CPUs for data packet processing and reduce context switches between CPUs.
sudo sh -c 'for x in /sys/class/net/eth0/queues/rx-*; do echo ffffffff>$x/rps_cpus; done'
sudo sh -c "echo 32768 > /proc/sys/net/core/rps_sock_flow_entries"
sudo sh -c "echo 4096 > /sys/class/net/eth0/queues/rx-0/rps_flow_cnt"
sudo sh -c "echo 4096 > /sys/class/net/eth0/queues/rx-1/rps_flow_cnt"
Note:
ffffffff indicates that 32 CPUs are used (1 f represents 4 CPUs).

Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback