在centos6.x上node
yum install sysbench |
的時候由於sysbench會依賴於mysql,而無論是系統自帶的原生的mysql-server,仍是mysql分支percona-server,都會跟咱們裝的percona-xtradb-cluster衝突,因此,幸虧我找了第四臺機器來安裝sysbench,具體測試步驟以下:mysql
首先,登陸percona xtradb cluster的其中一臺機器,這裏登node1(10.0.0.1),執行mysql登入系統,並建立測試用數據庫sbtest並賦予權限給用戶sbtest(密碼是sbtest)sql
yum install sysbench |
而後,登陸第四臺機器(ip是10.0.0.4),安裝sysbench並跑測試程序。數據庫
yum-yinstall sysbench sysbench --test=oltp --mysql-host=10.0.0.1,10.0.0.2,10.0.0.3 --mysql-user=sbtest --mysql-password=sbtest --db-driver=mysql prepare sysbench --test=oltp --mysql-host=10.0.0.1,10.0.0.2,10.0.0.3 --mysql-user=sbtest --mysql-password=sbtest --db-driver=mysql run
這是最後輸出的結果:centos
sysbench 0.4.12: multi-threaded system evaluation benchmark 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 "BEGIN" 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 (21.26 per sec.) deadlocks: 0 (0.00 per sec.) read/write requests: 190000 (403.93 per sec.) other operations: 20000 (42.52 per sec.) Test execution summary: total time: 470.3826s total number of events: 10000 total time taken by event execution: 470.2785 per-request statistics: min: 27.22ms avg: 47.03ms max: 458.16ms approx. 95 percentile: 99.91ms Threads fairness: events (avg/stddev): 10000.0000/0.00 execution time (avg/stddev): 470.2785/0.00
最後,清除測試數據:bash
sysbench --test=oltp --mysql-host=10.0.0.1,10.0.0.2,10.0.0.3 --mysql-user=sbtest --mysql-password=sbtest --db-driver=mysql cleanup