性能测试工具sysbench简介
作者:网络转载 发布时间:[ 2014/1/21 10:58:14 ] 推荐标签:性能测试 测试工具
MySQL数据库测试
首先需要创建默认的sbtest数据库,或者使用-mysql-db指定一个已经存在的数据库
生成测试数据,引擎为myisam,表大小为1000000条记录
以下是引用片段:
NinGoo:/u01/sysbench/bin>$sysbench --test=oltp --mysql-table-engine=myisam --oltp-table-size=1000000
--mysql-user=root --mysql-socket=/opt/mysql/run/mysql.sock prepare
sysbench 0.4.12: multi-threaded system evaluation benchmark
No DB drivers specified, using mysql
Creating table ’sbtest’...
Creating 1000000 records in table ’sbtest’...
root@sbtest 11:42:18>desc sbtest.sbtest;
+-------+------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------+------------------+------+-----+---------+----------------+
| id | int(10) unsigned | NO | PRI | NULL | auto_increment |
| k | int(10) unsigned | NO | MUL | 0 | |
| c | char(120) | NO | | | |
| pad | char(60) | NO | | | |
+-------+------------------+------+-----+---------+----------------+
执行测试
以下是引用片段:
NinGoo:/u01/sysbench/bin>$sysbench --test=oltp --mysql-table-engine=myisam --oltp-table-size=1000000
--mysql-user=root --mysql-socket=/opt/mysql/run/mysql.sock run
sysbench 0.4.12: multi-threaded system evaluation benchmark
No DB drivers specified, using mysql
Running the test with following options:
Number of threads: 1
Doing OLTP test.
Running mixed OLTP test
Using Special distribution (12 iterations, 1 pct of values are returned in 75 pct cases)
Using "LOCK TABLES WRITE" for starting transactions
Using auto_inc on the id column
Maximum number of requests for OLTP test is limited to 10000
Threads started!
Done.
OLTP test statistics:
queries performed:
read: 140000
write: 50000
other: 20000
total: 210000
transactions: 10000 (336.64 per sec.)
deadlocks: 0 (0.00 per sec.)
read/write requests: 190000 (6396.11 per sec.)
other operations: 20000 (673.27 per sec.)
Test execution summary:
total time: 29.7056s
total number of events: 10000
total time taken by event execution: 29.6301
per-request statistics:
min: 2.27ms
avg: 2.96ms
max: 43.88ms
approx. 95 percentile: 3.36ms
Threads fairness:
events (avg/stddev): 10000.0000/0.00
execution time (avg/stddev): 29.6301/0.00
相关推荐
更新发布
功能测试和接口测试的区别
2023/3/23 14:23:39如何写好测试用例文档
2023/3/22 16:17:39常用的选择回归测试的方式有哪些?
2022/6/14 16:14:27测试流程中需要重点把关几个过程?
2021/10/18 15:37:44性能测试的七种方法
2021/9/17 15:19:29全链路压测优化思路
2021/9/14 15:42:25性能测试流程浅谈
2021/5/28 17:25:47常见的APP性能测试指标
2021/5/8 17:01:11