This document describes how to install SysBench, a performance testing tool for TencentDB for MySQL, in a CVM instance.
SysBench is a modular, cross-platform, and multi-threaded benchmark tool for evaluating OS parameters that are important for a system running a database under intensive load. The idea of this benchmark suite is to quickly get an impression about system performance without setting up complex database benchmarks or even without installing a database at all.
POINT SELECT
queries and four range queries).UPDATE
statements, one DELETE
statement, and one INSERT
statement).Parameter | Description |
---|---|
db-driver | Database engine |
mysql-host | MySQL server host |
mysql-port | MySQL server port |
mysql-user | MySQL user |
mysql-password | MySQL password |
mysql-db | MySQL database name |
table_size | Test table size |
tables | Number of test tables |
events | Number of test requests |
time | Test time |
threads | Number of test threads |
percentile | The percentile range to be counted, which is 95% by default, i.e., the execution times of requests in 95% of the cases |
report-interval | Interval for outputting a test progress report in seconds. 0 indicates to output only the final result but not the test progress report |
skip-trx | Whether to skip transactions 1: Yes 0: No |
This stress test uses SysBench 1.0.20. For more information, see here.
Run the following command to install SysBench in a CVM instance:
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 GitHub
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
Run the following command to configure the client, so that the kernel can use all CPU cores to process data packets and reduce context switches within each CPU core.
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 CPU cores are used (onef
represents four CPU cores).
Was this page helpful?