In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly shows you "how to use Mysql5.7 stress test command mysqlslap". The content is simple and clear. I hope it can help you solve your doubts. Let me lead you to study and learn this article "how to use Mysql5.7 stress test command mysqlslap".
Preface
Mysqlslap is a diagnostics program designed to simulate the client load on the MySQL server and report the time of each phase. It works as if multiple clients are accessing the server.
1. The syntax used:
Mysqlslap [options]
-- auto-generate-sql,-a: automatically generates test tables and data to represent testing concurrent stress with SQL scripts generated by mysqlslap itself.
-- auto-generate-sql-load-type=type: type of test statement. Values include: read,key,write,update and mixed (default).
-- auto-generate-sql-add-auto-increment: automatically adds auto_increment columns to the generated table.
-- create-schema: custom test library name.
-- commint=N: submit once after setting N DML.
-- compress,-C: if both the server and client support compression, the compression information is passed.
-- concurrency=N,-CN: indicates the concurrency, that is, how many clients are simulated to execute select at the same time. Multiple values can be specified, for example:-- concurrency=100200500.
-- detach=N: disconnect the reconnection after executing N statements.
-- debug-info,-T: print information about memory and CPU.
-- engine=engine_name,-e engine_name: there can be multiple engines to test, separated by delimiters. For example:-- engines=myisam,innodb.
-- iterations=N,-I N: the number of iterations of the test execution, indicating how many times the test will be run in different concurrency environments.
-- number-char-cols=N,-x N: the automatically generated test table contains N character type columns. The default is 1.
-- number-int-cols=N,-y N: the automatically generated test table contains N columns of numeric types, with a default of 1.
-- number-of-queries=N: total number of test queries (concurrent customers × queries per customer).
-- only-print: only test statements are printed and not actually executed.
-- query=name,-q: use custom scripts to execute tests, for example, you can customize a stored procedure or sql statement to execute tests.
2. Case
Test 100 concurrency, automatically generate SQL test scripts, and execute 1000 total queries:
Root# mysqlslap-uroot-p123456-a-- concurrency=100-- number-of-queries 1000 Benchmark Average number of seconds to run all queries: 0.725 seconds Minimum number of seconds to run all queries: 0.725 seconds Maximum number of seconds to run all queries: 0.725 seconds Number of clients running queries: 100 Average number of queries per client: 10
Test 100 concurrent threads, test 5 times, automatically generate SQL test scripts, read, write, update mixed tests, self-growing fields, test engine innodb, execute 5000 total queries
Root# mysqlslap-uroot-p123456--concurrency=100-- iterations=5-- auto-generate-sql--auto-generate-sql-load-type=mixed-- auto-generate-sql-add-autoincrement-- engine=innodb-- number-of-queries=5000Benchmark Running for engine innodb Average number of seconds to run all queries: 1.264 seconds Minimum number of seconds to run all queries: 1.161 seconds Maximum number of seconds to run all queries: 1.404 seconds Number of clients running queries: 100 Average number of queries per client: 50 is "Mysql5.7 pressure measurement" Try to command mysqlslap how to use all the contents of this article. Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more 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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.