Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

MySQL benchmark tool sysbench installation

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Introduction to sysbench

The tool is currently available in three versions 0.4, 0.5 and 1.0, with some differences in syntax and parameters. This paper is the latest version 1.0.9, which is a multithreaded benchmark tool based on LuaJIT, which is often used for database benchmark testing, and can also test the key subsystems of the operating system. In addition to built-in testing, you can also write Lua scripts to achieve specific business testing.

Sysbench download

Link, https://github.com/akopytov/sysbench

Installation depends on the environment

1. Yum-y install make automake libtool pkgconfig libaio-devel vim-common

two。 Sets the client library file from where to load the MySQL database.

[root@db01 ~] # cat / etc/ld.so.conf.d/mysql.conf

/ opt/mysql/lib

[root@db01 ~] # ldconfig

[root@db01 ~] # ldconfig-- print-cache | grep 'mysql'

Libmysqlclient.so.18 (libc6,x86-64) = > / opt/mysql/lib/libmysqlclient.so.18

Installation

1. [root@db01 sysbench-1.0.9] #. / autogen.sh

[root@db01 sysbench-1.0.9] #. / configure-prefix=/usr/local/sysbench-1.0.9

[root@db01 sysbench-1.0.9] # make-j 4

[root@db01 sysbench-1.0.9] # make install

two。 Write the path of the command sysbench to the environment variable PATH.

[root@db01 ~] # grep 'PATH' .bash _ profile

PATH=/usr/local/sysbench-1.0.9/bin:/opt/mysql/bin:$PATH:$HOME/bin

Export PATH

[root@db01 ~] # source .bash _ profile

3. View the client library file of the MySQL database used by the command sysbench.

[root@db01 ~] # ldd / usr/local/sysbench-1.0.9/bin/sysbench | grep 'mysql'

Libmysqlclient.so.18 = > / opt/mysql/lib/libmysqlclient.so.18 (0x00007f4376099000)

The following are test examples of fileio and oltp, respectively.

1. [root@db01 sysbench_test] # sysbench fileio-- file-num=4-- file-block-size=16384-- file-total-size=100G-- file-test-mode=rndrd-- file-extra-flags=direct-- threads=16-- events=0-- time=14400-- report-interval=4-- verbosity=3 [prepare | run | cleanup]

2. [root@db01 sysbench_test] # sysbench/ usr/local/sysbench-1.0.9/share/sysbench/oltp_insert.lua-- auto_inc=on-- tables=10-- mysql_storage_engine=innodb-- table_size=5000000-- threads=16-- events=0-- time=14400-- report-interval=4-- verbosity=3-- mysql-host=localhost-- mysql-port=3306-- mysql-socket=/data/3306/mysql.sock-- mysql-user=root-- mysql-password=123456-- mysql-db=sbtest [prepare | run | cleanup]

If you are interested, please follow Subscription account's Database Best practices (DBBestPractice).

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report