tencent cloud

Testing Tool
Last updated: 2025-12-10 14:30:52
Testing Tool
Last updated: 2025-12-10 14:30:52
This document describes the sysbench tool for performance testing for TDSQL-C for MySQL, as well as how to install sysbench on a CVM instance.

Introduction to the sysbench Tool

sysbench is an open-source, cross-platform, multi-threaded modular benchmarking tool designed to evaluate the performance of core parameters when systems run high-load databases. It allows you to bypass complex database benchmark setups and quickly assess database system performance even without installing a database. Primarily used for database benchmarking and system performance testing (such as CPU, memory, I/O, and threads).

Parameter Description for sysbench

Parameter
Description
db-driver
Database engine.
mysql-host
TDSQL-C for MySQL connection address of the instance.
mysql-port
TDSQL-C for MySQL connection port of the instance.
mysql-user
TDSQL-C for MySQL instance account.
mysql-password
TDSQL-C for MySQL instance account's corresponding password.
mysql-db
TDSQL-C for MySQL database name of the instance.
table_size
Size of the test table.
tables
Number of test tables.
events
Number of test requests.
time
Test time.
threads
Number of test threads.
percentile
The percentile to be calculated, with a default value of 95%, meaning the execution time for 95% of requests.
report-interval
It indicates that a report on test progress is output every N seconds; 0 disables the output of the report on test progress and only outputs the result of the final report.
skip-trx
Whether to skip the transaction.
1: Skip.
0: Do not skip.

Installation Methods

This stress test uses sysbench version 1.0.20 (using bundled LuaJIT 2.1.0-beta2). For more information, see sysbench official documentation.
Note:
One client supports 1000 concurrent connections. When the concurrency exceeds 1000, add one client, and so on.
1. Run the following command on a 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 version 1.0.20
./autogen.sh
## Run autogen.sh
./configure --prefix=/usr --mandir=/usr/share/man
make
## Compile
make install
2. Run the following command to configure the client, enabling the kernel to utilize all CPUs for packet processing while reducing context switching 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 represents the use of 32 CPUs (one 'f' represents 4 CPUs).
Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback