sysbench 压测试 atlas中间件问题
弘恩 2016-09-09 11:12:13 环境
sysbench 0.5 ,mysql 5.7.14 ,atlas Atlas-2.2.1.el6.x86_64.rpm
3台虚拟机 M 143 ,S145 , Atlas149
用atlas中间件 对mysql进行读写分离
目标:
用sysbench 对atlas 进行压测试,检查在使atlas中间件读写分离后的mysql集群整体的性能吞吐情况
过程:
1. sysbench 直接对主库加压,命令如下
#sysbench --mysql-table-engine=innodb --oltp-table-size=10000 --debug=on --num-threads=3 --mysql-db=db1 --mysql-user=root --mysql-host=192.168.186.143 --mysql-password=123456 --port=3306 --test=/usr/local/sysbench/sysbench/tests/db/oltp.lua --oltp_tables_count=3 prepare
sysbench 0.5: multi-threaded system evaluation benchmark
No DB drivers specified, using mysql
Creating table 'sbtest1'...
Inserting 10000 records into 'sbtest1'
Creating secondary indexes on 'sbtest1'...
Creating table 'sbtest2'...
Inserting 10000 records into 'sbtest2'
Creating secondary indexes on 'sbtest2'...
Creating table 'sbtest3'...
Inserting 10000 records into 'sbtest3'
Creating secondary indexes on 'sbtest3'...
[root@localhost /usr/local/sysbench-0.5/bin]
#sysbench --mysql-table-engine=innodb --oltp-table-size=10000 --debug=on --num-threads=3 --mysql-db=db1 --mysql-user=root --mysql-host=192.168.186.143 --mysql-password=123456 --port=3306 --test=/usr/local/sysbench/sysbench/tests/db/oltp.lua --oltp_tables_count=3 run
sysbench 0.5: multi-threaded system evaluation benchmark
Running the test with following options:
Number of threads: 3
Debug mode enabled.
Random number generator seed is 0 and will be ignored
Initializing worker threads...
No DB drivers specified, using mysql
DEBUG: Worker thread (#2) started!
DEBUG: Worker thread (#1) started!
DEBUG: Worker thread (#0) started!
Threads started!
DEBUG: Ignoring error 1213 Deadlock found when trying to get lock; try restarting transaction,
DEBUG: Ignored error encountered, restarting transaction
DEBUG: Ignoring error 1213 Deadlock found when trying to get lock; try restarting transaction,
DEBUG: Ignored error encountered, restarting transaction
DEBUG: Ignoring error 1213 Deadlock found when trying to get lock; try restarting transaction,
DEBUG: Ignored error encountered, restarting transaction
DEBUG: Ignoring error 1213 Deadlock found when trying to get lock; try restarting transaction,
DEBUG: Ignored error encountered, restarting transaction
DEBUG: Ignoring error 1213 Deadlock found when trying to get lock; try restarting transaction,
DEBUG: Ignored error encountered, restarting transaction
DEBUG: Ignoring error 1213 Deadlock found when trying to get lock; try restarting transaction,
DEBUG: Ignored error encountered, restarting transaction
DEBUG: Ignoring error 1213 Deadlock found when trying to get lock; try restarting transaction,
DEBUG: Ignored error encountered, restarting transaction
Done.
OLTP test statistics:
queries performed:
read: 140098
write: 40007
other: 20007
total: 200112
transactions: 10000 (39.26 per sec.)
read/write requests: 180105 (707.04 per sec.)
other operations: 20007 (78.54 per sec.)
ignored errors: 7 (0.03 per sec.)
reconnects: 0 (0.00 per sec.)
General statistics:
total time: 254.7299s
total number of events: 10000
total time taken by event execution: 764.0871s
response time:
min: 27.57ms
avg: 76.41ms
max: 539.19ms
approx. 95 percentile: 246.52ms
Threads fairness:
events (avg/stddev): 3333.3333/5.56
execution time (avg/stddev): 254.6957/0.01
DEBUG: Verbose per-thread statistics:
DEBUG: thread # 0: min: 0.0280s avg: 0.0765s max: 0.5086s events: 3328
DEBUG: total time taken by even execution: 254.6939s
DEBUG: thread # 1: min: 0.0321s avg: 0.0765s max: 0.4619s events: 3331
DEBUG: total time taken by even execution: 254.7094s
DEBUG: thread # 2: min: 0.0276s avg: 0.0762s max: 0.5392s events: 3341
DEBUG: total time taken by even execution: 254.6837s
2 sysbench 连接Atlas代理进行加压,命令如下
#sysbench --mysql-table-engine=innodb --oltp-table-size=10000 --debug=on --num-threads=3 --mysql-db=db1 --mysql-user=root --mysql-host=192.168.186.149 --mysql-password=123456 --port=1234 --test=/usr/local/sysbench/sysbench/tests/db/oltp.lua --oltp_tables_count=3 prepare
sysbench 0.5: multi-threaded system evaluation benchmark
No DB drivers specified, using mysql
FATAL: unable to connect to MySQL server, aborting...
FATAL: error 2003: Can't connect to MySQL server on '192.168.186.149' (111)
FATAL: failed to execute function `prepare': /usr/local/sysbench/sysbench/tests/db/common.lua:103: Failed to connect to the database