Throughput:
read: IOPS=204.22 3.19 MiB/s (3.35 MB/s)
write: IOPS=136.15 2.13 MiB/s (2.23 MB/s)
fsync: IOPS=442.70
Latency (ms):
min: 0.00
avg: 5.14
max: 310.70
95th percentile: 35.59
sum: 239996.51
[root@slave1 sysbench-master]# sysbench --threads=4 --time=60 --report-interval=10 --file-test-mode=rndrw fileio cleanup #清理文件
sysbench 1.1.0 (using bundled LuaJIT 2.1.0-beta3)
Removing test files...
•内存测试 ◦测试4个线程,60秒,每10秒输出一次报告信息,总内存大小100G,随机访问模式
[root@slave1 sysbench-master]# sysbench --threads=4 --time=60 --report-interval=10 --memory-total-size=100G --memory-access-mode=rnd memory run
sysbench 1.1.0 (using bundled LuaJIT 2.1.0-beta3)
Running the test with following options:
Number of threads: 4
Report intermediate results every 10 second(s)
Initializing random number generator from current time
Running memory speed test with the following options:
block size: 1KiB
total size: 102400MiB
operation: write
scope: global
Initializing worker threads...
Threads started!
[ 10s ] 671.96 MiB/sec
[ 20s ] 672.65 MiB/sec
[ 30s ] 667.18 MiB/sec
[ 40s ] 675.73 MiB/sec
[ 50s ] 676.82 MiB/sec
Total operations: 41341475 (689021.00 per second)
40372.53 MiB transferred (672.87 MiB/sec)
Throughput:
events/s (eps): 689021.0010
time elapsed: 60.0003s
total number of events: 41341475
Latency (ms):
min: 0.00
avg: 0.01
max: 20.25
95th percentile: 0.00
sum: 218390.97
Threads fairness:
events (avg/stddev): 10335368.7500/59009.67
execution time (avg/stddev): 54.5977/0.14
•MySQL测试 ◦压测实例,4张表,每张表10W条记录,压测120秒
sysbench --db-driver=mysql --time=120 --threads=4 --report-interval=10 --mysql-host=localhost --mysql-port=2433 --mysql-socket=/data/mysqldata/mysql.sock --mysql-user=7roaddba --mysql-password=y%6bm@3o_q1a --mysql-db=inc --tables=4 --table-size=100000 oltp_read_write prepare ##准备
sysbench --db-driver=mysql --time=120 --threads=4 --report-interval=10 --mysql-host=localhost --mysql-port=3306 --mysql-socket=/data/mysqldata/mysql.sock --mysql-user=7roaddba --mysql-password=y%6bm@3o_q1a --mysql-db=inc --tables=4 --table-size=100000 oltp_read_write run ##测试
sysbench 1.1.0 (using bundled LuaJIT 2.1.0-beta3)
Running the test with following options:
Number of threads: 4
Report intermediate results every 10 second(s)
Initializing random number generator from current time
Initializing worker threads...
Threads started!
[ 10s ] thds: 4 tps: 111.37 qps: 2233.72 (r/w/o: 1564.69/445.88/223.14) lat (ms,95%): 101.13 err/s: 0.00 reconn/s: 0.00
[ 20s ] thds: 4 tps: 197.50 qps: 3950.22 (r/w/o: 2764.42/790.80/395.00) lat (ms,95%): 44.98 err/s: 0.00 reconn/s: 0.00
[ 30s ] thds: 4 tps: 211.10 qps: 4222.06 (r/w/o: 2955.87/843.99/422.20) lat (ms,95%): 44.17 err/s: 0.00 reconn/s: 0.00
[ 40s ] thds: 4 tps: 213.70 qps: 4272.79 (r/w/o: 2991.39/854.00/427.40) lat (ms,95%): 43.39 err/s: 0.00 reconn/s: 0.00
[ 50s ] thds: 4 tps: 211.80 qps: 4239.27 (r/w/o: 2967.15/848.41/423.71) lat (ms,95%): 43.39 err/s: 0.10 reconn/s: 0.00
[ 60s ] thds: 4 tps: 223.10 qps: 4459.15 (r/w/o: 3121.36/891.59/446.19) lat (ms,95%): 41.85 err/s: 0.00 reconn/s: 0.00
[ 70s ] thds: 4 tps: 190.40 qps: 3811.24 (r/w/o: 2667.73/762.71/380.80) lat (ms,95%): 45.79 err/s: 0.00 reconn/s: 0.00
[ 80s ] thds: 4 tps: 183.00 qps: 3660.05 (r/w/o: 2561.97/732.09/366.00) lat (ms,95%): 43.39 err/s: 0.00 reconn/s: 0.00
[ 90s ] thds: 4 tps: 211.60 qps: 4226.63 (r/w/o: 2958.32/845.11/423.20) lat (ms,95%): 44.17 err/s: 0.00 reconn/s: 0.00
[ 100s ] thds: 4 tps: 213.30 qps: 4272.92 (r/w/o: 2991.64/854.58/426.69) lat (ms,95%): 39.65 err/s: 0.10 reconn/s: 0.00
[ 110s ] thds: 4 tps: 212.51 qps: 4249.12 (r/w/o: 2974.88/849.22/425.01) lat (ms,95%): 41.10 err/s: 0.00 reconn/s: 0.00
[ 120s ] thds: 4 tps: 183.00 qps: 3660.19 (r/w/o: 2561.80/732.40/366.00) lat (ms,95%): 51.94 err/s: 0.00 reconn/s: 0.00
SQL statistics:
queries performed:
read: 330820 #总select数量
write: 94513 # 总update,insert,delete数量
other: 47258 ##commit,unlock tables 数量
total: 472591
transactions: 23628 (196.88 per sec.) #通常需要关注的数字(TPS)
queries: 472591 (3937.94 per sec.) #
ignored errors: 2 (0.02 per sec.) # 忽略的错误数
reconnects: 0 (0.00 per sec.)