In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
Editor to share with you how to use MySQL benchmark stress testing tool MySQLSlap, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's learn about it!
Common explanations:
[root@zhanglin] # mysqlslap-- help
Mysqlslap Ver 1.0 Distrib 5.1.73, for redhat-linux-gnu (x86 / 64)
Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
Affiliates. Other names may be trademarks of their respective
Owners.
Run a query multiple times against the server.
Usage: mysqlslap [OPTIONS]
Default options are read from the following files in the given order:
/ etc/mysql/my.cnf / etc/my.cnf ~ / .my.cnf
The following groups are read: mysqlslap client
The following options may be given as the first argument:
-- print-defaults Print the program argument list and exit.
-- no-defaults Don't read default options from any option file.
Defaults-file=# Only read default options from the given file #.
-- defaults-extra-file=# Read this file after the global files are read.
-?-- help Display this help and exit.
-a,-- auto-generate-sql
Generate SQL where not supplied by file or command line. / / the system comes with a generated SQL script test, not a file or command line.
-- auto-generate-sql-add-autoincrement
Add an AUTO_INCREMENT column to auto-generated tables. / / starting from version 5.1.18,? Indicates that the auto_increment column is automatically added to the generated table.
-- auto-generate-sql-execute-number=#
Set this number to generate a set number of queries to / / sets the number of times the session executes SQL statements
Run.
-- auto-generate-sql-guid-primary
Add GUID based primary keys to auto-generated tables. / / add GUID fields to the test table according to the primary key
-- auto-generate-sql-load-type=name
Specify test load type: mixed, update, write, key, or / / represents whether to test read or write or a mixture of both. The default is mixed mode.
Read; default is mixed.
-- auto-generate-sql-secondary-indexes=#
Number of secondary indexes to add to auto-generated / / automatically grows the number of indexes in the table except the primary key.
Tables.
-- auto-generate-sql-unique-query-number=#
Number of unique queries to generate for automatic tests. / / the number of different queries generated by the automatic test.
-- auto-generate-sql-unique-write-number=#
Number of unique queries to generate for / / the number of different write SQL statements generated by the automatic test.
Auto-generate-sql-write-number.
-- auto-generate-sql-write-number=#
Number of row inserts to perform for each thread (default / / number of write SQL per thread.
Is 100).
-- commit=# Commit records every X number of statements. / / how many DML will be submitted once.
-C.-- compress Use compression in server/client protocol. / / use compression.
-c,-- concurrency=name
Number of clients to simulate for query to run. / / the number of client concurrency. Multiple clients can be separated by commas, for example: concurrency=100,500,1000. The number of concurrent connection threads is 100,500,1000 respectively.
-- create=name File or string to use create tables. / / Table name, which can be specified directly or to a file.
-- create-schema=name
Schema to run tests in. / / with what user to test.
-- csv [= name] Generate CSV output to named file or to stdout if no file / / outputs test results as a CSV file.
Is named.
-#-- debug [= #] This is a non-debug version. Catch this and exit.
-- debug-check Check memory and open file usage at exit. / / check CPU and memory related information.
-T,-- debug-info Print some debug info at exit. / / print debug information at the end.
-F,-- delimiter=name
Delimiter to use in SQL statements supplied in file or
Command line.
-detach=# Detach (close and reopen) connections after X number of
Requests.
-e,-- engine=name Storage engine to use for creating the table. / / Storage engine to be tested.
-h,-- host=name Connect to host. / / the database host to be tested.
-I,-iterations=# Number of times to run the tests. / /-the number of times the I N test is executed represents how many times you want to run the test in different concurrent environments.
-- no-drop Do not drop the schema after the test. / / the test is over, and the test user data is retained.
-x,-- number-char-cols=name / / the number of varchar fields used to create the test table. The default is 1.
Number of VARCHAR columns to create in table if
Specifying-- auto-generate-sql.
-y,-- number-int-cols=name / / the number of int fields used to create the test table. The default is 1.
Number of INT columns to create in table if specifying
-- auto-generate-sql.
-- number-of-queries=#
Limit each client to this number of queries (this is not / / the total number of SQL executed by each client (concurrent customers x queries per customer).
Exact).
-- only-print Do not connect to the databases, but instead print out / / only prints test statements and does not actually execute them. Similar to daily review of the implementation plan
What would have been done.
-p,-- password [= name]
Password to use when connecting to server. If password is / / the login password of the user in the linked MySQL database.
Not given it's asked from the tty.
-P,-port=# Port number to use for connection. / / Port number.
-- SQL statement executed after post-query=name Query to run or file containing query to execute after / / test
Tests have completed.
Post-system=name system () string to execute after tests have completed. / / operating system statements executed after testing
-- SQL statement executed before pre-query=name Query to run or file containing query to execute before / / Test
Running tests.
Pre-system=name system () string to execute before running tests. / / operating system statements executed before testing
-- protocol=name The protocol to use for connection (tcp, socket, pipe, / / Link protocols used by linked servers)
Memory).
-Q,-- query=name Query to run or file containing query to run. / / the SQL statements tested are generally self-designed SQL
-s,-- silent Run program in silent mode-no output. / / do not display the test
-S,-- socket=name The socket file to use for connection. / / socket tunnel file for connecting to the server
-ssl Enable SSL for connection (automatically enabled with
Other flags). Disable with-- skip-ssl.
-- ssl-ca=name CA file in PEM format (check OpenSSL docs, implies
Ssl).
Ssl-capath=name CA directory (check OpenSSL docs, implies-- ssl).
Ssl-cert=name X509 cert in PEM format (implies-- ssl).
Ssl-cipher=name SSL cipher to use (implies-- ssl).
Ssl-key=name X509 key in PEM format (implies-- ssl).
-- ssl-verify-server-cert
Verify server's "Common Name" in its cert against
Hostname used when connecting. This option is disabled by
Default.
-u,-- user=name User for login if not current user. / / Log in to MySQL user
-v,-- verbose More verbose output; you can use this multiple times to / / more detailed output.
Get even more verbose output.
V,-- version Output version information and exit. / / version information
Test commands:
Mysqlslap-uroot-pzhanglin-concurrency=1000-- iterations=10-- auto-generate-sql--auto-generate-sql-load-type=mixed-- auto-generate-sql-add-autoincrement-- engine=myisam-- number-of-queries=10-- debug-info
# Note this test uses 1000 concurrent threads and 10 tests, automatically generates SQL test scripts, reads, writes, updates mixed tests, self-growing fields, test engine myisam, runs a total of 10 queries, and outputs cpu resource information
Mysqlslap-concurrency=10,200,1000-iterations=20-number-int-cols=8-number-char-cols=30-auto-generate-sql--auto-generate-sql-add-autoincrement-auto-generate-sql-load-type=read-engine=myisam,innodb-number-of-queries=5000-verbose-socket=/tmp/mysql/mysql.sock uroot pzhanglin
# system script test, add int type 8 columns char type 30 columns, test the performance of myisam,innodb reading of two kinds of engines, respectively, test the server with a total of 5000 query statements and execute 20 queries.
The above is all the content of the article "how to use MySQL benchmark stress testing tool MySQLSlap". 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.