Get the App
SLTechnology News&Howtos  ›  Database  › 

What's the use of sysbench 0.5?

Shulou Source: shulou.com Published: 2022-05-31 15:28:02 11月03日 Update

This article mainly introduces the use of sysbench 0.5, the article is very detailed, has a certain reference value, interested friends must read it!

A preface

Because of the work in preparing to do stress testing, we can see that the latest version of sysbench is 0.5. compared with the previous version of 0.4, the biggest change is the change of test parameters. when testing MySQL, the value of test in the new version will be lua script, which brings great flexibility to the stress testing work.

Second installation

Because the previous blog post has talked about how to install sysbench, this article does not explain too much, but you need to be prompted to make sure that the packages of M4 autoconf automake libtool are installed in the current system

If not, install via yum install-y M4 autoconf automake libtool

Get sysbench and install

. / autogen.sh

. / configure-prefix=/opt/sysbench-with-mysql--with-mysql-includes=/opt/mysql/include-with-mysql-libs=/usr/lib64/mysql

After the make and make install installation is complete, execute sysbench-- help to see the complete help.

After the installation is complete, execute sysbench-help to see the complete help.

Third use

The previous version 0.5 test values are lua scripts. Check which scripts can be used for db stress testing.

[root@rac4 11:32:45 ~ / sysbench/sysbench/tests/db]

# ls * .lua

Common.lua insert.lua oltp_simple.lua select.lua select_random_ranges.lua update_non_index.lua

Delete.lua oltp.lua parallel_prepare.lua select_random_points.lua update_index.lua

Take a look at the most typical scripts used in stress testing.

[root@rac4 11:36:32 ~ / sysbench/sysbench/tests/db]

# more update_non_index.lua

Pathtest = string.match (test, ". * /) or"

Dofile (pathtest. "common.lua")

Function thread_init (thread_id)

Set_vars ()

End

Function event (thread_id)

Local table_name

Local c_val

Local query

Table_name = "sbtest".. Sb_rand_uniform (1, oltp_tables_count)

C_val = sb_rand_str ("#-#")

Query = "UPDATE".. Table_name.. "SET clockwork".. C_val.. "'WHERE id=".. Sb_rand (1, oltp_table_size)

Rs = db_query (query)

End

If you know lua scripts, you can simply customize the stress test scripts according to your business scenarios.

Cd / root/sysbench/

/ opt/sysbecn/bin/sysbench-test=./sysbench/tests/db/update_non_index.lua-mysql-table-engine=innodb-mysql-db=test-oltp-table-size=5000000-mysql-user=root-mysql-socket=/srv/my3308/run/mysql.sock-oltp-tables-count=16 prepare

/ opt/sysbecn/bin/sysbench-test=./sysbench/tests/db/update_non_index.lua-mysql-table-engine=innodb-mysql-db=test-oltp-table-size=5000000-mysql-user=root-mysql-socket=/srv/my3308/run/mysql.sock-oltp-tables-count=16 run

/ opt/sysbecn/bin/sysbench-test=./sysbench/tests/db/update_non_index.lua-mysql-table-engine=innodb-mysql-db=test-oltp-table-size=5000000-mysql-user=root-mysql-socket=/srv/my3308/run/mysql.sock-oltp-tables-count=16 cleanup

Fourth, the problems encountered

#. / autogen.sh

Libtoolize 1.4 + wasn't found, exiting

#. / autogen.sh

Automake 1.10.x (aclocal) wasn't found, exiting

The installation package of libtool and automake needs to be installed.

After installing the above packages, I also encountered the following errors:

Libtool: link: gcc-W-Wall-Wextra-Wpointer-arith-Wbad-function-cast-Wstrict-prototypes-Wnested-externs-Winline-funroll-loops-Wundef-Wstrict-prototypes-Wmissing-prototypes-Wmissing-declarations-Wredundant-decls-Wcast-align-pthread-O2-ggdb3-o sysbench sysbench.o sb_timer.o sb_options.o sb_logger.o db_driver.o tests/fileio/libsbfileio.a tests/threads/libsbthreads.a tests/memory/libsbmemory.a tests/cpu/libsbcpu.a tests/mutex / libsbmutex.a scripting/libsbscript.a drivers/mysql/libsbmysql.a-L/opt/mysql/lib-lmysqlclient_r scripting/lua/src/liblua.a-ldl-lrt-lm-pthread

/ usr/bin/ld: cannot find-lmysqlclient_r

Collect2: ld returned 1 exit status

The reason is that there is no libmysqlclient_r.so.16 because you do not have mysql-devel installed in your current environment. Solution method

Yum install-y mysql-devel

The above is all the content of this article "what is the use of sysbench 0.5". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Tags: Script version help content article work large maximum business value interest typical preface pressure reason parameters scenario guy partner way Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei macOS Linux Shulou Tech Info Microsoft