mysql 性能测试 mysqlslap 的使用介绍
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了mysql 性能测试 mysqlslap 的使用介绍,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含4010字,纯文字阅读大概需要6分钟。
内容图文
一、帮助文档
-?, --help Display this help and exit. (显示帮助并退出) -a, --auto-generate-sql Generate SQL where not supplied by file or command line. (自动生成sql语句) --auto-generate-sql-add-autoincrement Add an AUTO_INCREMENT column to auto-generated tables. (将自动增量列添加到自动生成的表中) --auto-generate-sql-execute-number=# Set this number to generate a set number of queries to run. (设置此数字以生成一组要运行的查询) --auto-generate-sql-guid-primary Add GUID based primary keys to auto-generated tables. (将基于guid的主键添加到自动生成的表中) --auto-generate-sql-load-type=name Specify test load type: mixed, update, write, key, or read; default is mixed. (指定测试加载类型:mixed、update、write、key或read;默认为mixed) --auto-generate-sql-secondary-indexes=# Number of secondary indexes to add to auto-generated tables. (要添加到自动生成的表中的辅助索引数) --auto-generate-sql-unique-query-number=# Number of unique queries to generate for automatic tests. (为自动测试生成的唯一查询数) --auto-generate-sql-unique-write-number=# Number of unique queries to generate for auto-generate-sql-write-number. (为自动生成SQL写入编号而要生成的唯一查询数) --auto-generate-sql-write-number=# Number of row inserts to perform for each thread (default is 100). (每个线程执行的行插入数(默认值为100)) --commit=# Commit records every X number of statements. (每隔x条语句提交一次记录) -C, --compress Use compression in server/client protocol. (在服务器/客户端协议中使用压缩) -c, --concurrency=name Number of clients to simulate for query to run. (要模拟以运行查询的客户端数) --create=name File or string to use create tables. (创建文件或字符串的名称) --create-schema=name Schema to run tests in. (指定测试库名称) -F, --delimiter=name Delimiter to use in SQL statements supplied in file or command line. (要在文件或中提供的SQL语句中使用的分隔符命令行) -e, --engine=name Storage engine to use for creating the table. (选择查询引擎) -h, --host=name Connect to host. (主机ip/域名) -i, --iterations=# Number of times to run the tests. (运行测试的次数) --no-drop Do not drop the schema after the test. (不要在测试后删除架构) -x, --number-char-cols=name Number of VARCHAR columns to create in table ifspecifying --auto-generate-sql. (要在表ifspecifying中创建的varchar列数--自动生成SQL) -y, --number-int-cols=name Number of INT columns to create in table if specifying --auto-generate-sql. (要在表ifspecifying中创建的int列数--自动生成SQL) --number-of-queries=# Limit each client to this number of queries (this is not exact). (将每个客户机限制为这个数量的查询(这不准确)) --only-print Do not connect to the databases, but instead print out (不要连接到数据库,而是打印出来) -p, --password[=name] Password to use when connecting to server. (连接服务器的密码) -P, --port=# Port number to use for connection. (连接服务器的端口) --protocol=name The protocol to use for connection (tcp, socket, pipe, memory). (用于连接的协议(TCP、套接字、管道、内存)) -q, --query=name Query to run or file containing query to run. (要运行的查询或包含要运行的查询的文件) -s, --silent Run program in silent mode - no output. (以静默模式运行程序-无输出) -S, --socket=name The socket file to use for connection. (用于连接的套接字文件) -u, --user=name User for login if not current user. (连接服务器的登陆名) -V, --version Output version information and exit. (输出版本并退出)
二、使用
单线程测试。测试做了什么。 # mysqlslap -a -uroot -p123456 多线程测试。使用–concurrency来模拟并发连接。 # mysqlslap -a -c 100 -uroot -p123456 迭代测试。用于需要多次执行测试得到平均值。 # mysqlslap -a -i 10 -uroot -p123456 50和100个并发分别得到一次测试结果(Benchmark),并发数越多,执行完所有查询的时间越长。为了准确起见,可以多迭代测试几次: # mysqlslap -a --concurrency=50,100 --number-of-queries 1000 --iterations=5 --debug-info -uroot -p123456
一般测试语句的使用
# mysqlslap --host=localhost --port=3306 --user=root --password='sss' --concurrency=100 --create-schema=aaa --query="ontest.sql" --delimiter=";"
内容总结
以上是互联网集市为您收集整理的mysql 性能测试 mysqlslap 的使用介绍全部内容,希望文章能够帮你解决mysql 性能测试 mysqlslap 的使用介绍所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。