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

How to use myslash and sysbench in Mysql

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

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces how to use myslash and sysbench in Mysql. It is very detailed and has certain reference value. Friends who are interested must finish reading it.

MYSLASH

-- auto-generate-sql,-an automatically generates test tables and data, indicating the concurrent stress of testing with the SQL script generated by the mysqlslap tool itself.

-- the type of auto-generate-sql-load-type=type test statement. Represents whether the environment to be tested is a read or write operation or a mixture of both. Values include: read,key,write,update and mixed (default).

-- auto-generate-sql-add-auto-increment represents the automatic addition of auto_increment columns to the generated table, which is supported from version 5.1.18.

-- number-char-cols=N,-x N automatically generated test table contains how many character types of columns. Default is 1.

-- number-int-cols=N,-y N automatically generated test table contains how many numeric columns. The default is 1.

-- the total number of number-of-queries=N test queries (concurrent customers × queries per customer)

-- query=name,-q uses custom scripts to execute tests, such as calling a custom stored procedure or sql statement to execute the test.

-- create-schema represents the name of the custom test library, and the schema in the tested schema,MySQL is database.

-- how many DML will be submitted after commint=N.

-- compress,-C if both the server and client support compression, the compression information is passed.

-- concurrency=N,-c N indicates concurrency, that is, how many clients are simulated to execute select at the same time. Multiple values can be specified with a comma or the value specified by the-- delimiter parameter as the delimiter. For example:-- concurrency=100200500.

-- engine=engine_name,-e engine_name represent the engine to be tested, and there can be multiple, separated by delimiters. For example:-- engines=myisam,innodb.

The number of iterations of the iterations=N,-I N test execution represents how many times the test will be run in different concurrency environments.

-- only-print only prints test statements and does not actually execute them.

-- detach=N disconnects the reconnection after executing N statements.

-- debug-info,-T prints information about memory and CPU.

Example:

Mysqlslap-a-auto-generate-sql-load-type=write-number-char-cols=10-number-int-cols=10-concurrency=100200600-iterations=2-number-of-queries=10000000-uroot-p123456

Mysqlslap-uroot-pJht123456-concurrency=10000-- iterations=1-- auto-generate-sql--auto-generate-sql-add-autoincrement-- auto-generate-sql-load-type=mixed-- engine=innodb-- number-of-queries=10-- debug-info-- only-print

SYSBENCH

Lua script location: cd / usr/share/sysbench/

Test IO

Sysbench-test=fileio-num-threads=16-file-total-size=20G-file-test-mode=rndrw prepare

Test OLTP

1Participation phase, generate the required test table

Sysbench oltp_read_write.lua-mysql-port=3306-db-driver=mysql-mysql-socket=/opt/mysql/my.sock-mysql-db=test_sysbench-mysql-user=root-mysql-password=123456-table_size=5000000-tables=10-threads=100-time=60-report-interval=10 prepare

2Query run stage

Sysbench oltp_read_write.lua-mysql-port=3306-db-driver=mysql-mysql-socket=/opt/mysql/my.sock-mysql-db=test_sysbench-mysql-user=root-mysql-password=123456-table_size=5000000-tables=10-threads=100-time=60-report-interval=10 run

3. Clean up the test tables generated during the test

Sysbench oltp_read_write.lua-mysql-port=3306-db-driver=mysql-mysql-socket=/opt/mysql/my.sock-mysql-db=test_sysbench-mysql-user=root-mysql-password=123456-table_size=5000000-tables=10-threads=100-time=60-report-interval=10 cleanup

Remote test OLTP

Sysbench oltp_read_write.lua-mysql-host=10.10.203.179-mysql-port=3306-db-driver=mysql-mysql-db=sys_test-mysql-user=js_dba-mysql-password=dba-table_size=50000-tables=10-threads=100-time=60-report-interval=10 run

The above is all the contents of the article "how to use myslash and sysbench in Mysql". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

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

Database

Wechat

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

12
Report