sysbench壓測實踐
軟體地址:
Redhat/CentOS採用如下方式安裝:
-
curl -s | sudo bash sudo yum -y install sysbench
sysbench --test=oltp --db-driver=mysql --mysql-table-engine=innodb --mysql-host=192.168.177.130 --mysql-port=3306 --mysql-db=testdb \
--mysql-user='root' --mysql-password='123456' --test=/usr/share/sysbench/tests/include/oltp_legacy/oltp.lua --oltp-table-size=500000 \
--oltp-tables-count=8 --num-threads=4 --max-time=1800 --max-requests=0 --report-interval=1 prepare
需要先做prepare, 否則會提示表不存在的錯誤
另外,mysql 8密碼認證方式相比5.7有所變化,需要修改使用者預設的密碼認證方式
ALTER USER 'root'@'%' IDENTIFIED BY '123456' PASSWORD EXPIRE NEVER; #修改加密規則
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '123456'; #更新一下使用者的密碼
[root@server2 ~]# sysbench --test=oltp --db-driver=mysql --mysql-table-engine=innodb --mysql-host=192.168.177.130 --mysql-port=3306 --mysql-db=testdb \
> --mysql-user='root' --mysql-password='123456' --test=/usr/share/sysbench/tests/include/oltp_legacy/oltp.lua --oltp-table-size=500000 \
> --oltp-tables-count=8 --num-threads=4 --max-time=1800 --max-requests=0 --report-interval=1 prepare
WARNING: the --test option is deprecated. You can pass a script name or path on the command line without any options.
WARNING: the --test option is deprecated. You can pass a script name or path on the command line without any options.
WARNING: --num-threads is deprecated, use --threads instead
WARNING: --max-time is deprecated, use --time instead
sysbench 1.0.20 (using bundled LuaJIT 2.1.0-beta2)
Creating table 'sbtest1'...
Inserting 500000 records into 'sbtest1'
Creating secondary indexes on 'sbtest1'...
Creating table 'sbtest2'...
Inserting 500000 records into 'sbtest2'
Creating secondary indexes on 'sbtest2'...
Creating table 'sbtest3'...
Inserting 500000 records into 'sbtest3'
Creating secondary indexes on 'sbtest3'...
Creating table 'sbtest4'...
Inserting 500000 records into 'sbtest4'
Creating secondary indexes on 'sbtest4'...
Creating table 'sbtest5'...
Inserting 500000 records into 'sbtest5'
Creating secondary indexes on 'sbtest5'...
Creating table 'sbtest6'...
Inserting 500000 records into 'sbtest6'
Creating secondary indexes on 'sbtest6'...
Creating table 'sbtest7'...
Inserting 500000 records into 'sbtest7'
Creating secondary indexes on 'sbtest7'...
Creating table 'sbtest8'...
Inserting 500000 records into 'sbtest8'
接下來壓測:
sysbench --test=oltp --db-driver=mysql --mysql-table-engine=innodb --mysql-host=192.168.177.130 --mysql-port=3306 --mysql-db=testdb \
--mysql-user='root' --mysql-password='123456' --test=/usr/share/sysbench/tests/include/oltp_legacy/oltp.lua --oltp-table-size=500000 \
--oltp-tables-count=8 --num-threads=4 --max-time=1800 --max-requests=0 --report-interval=1 run
root@server2 ~]# sysbench --test=oltp --db-driver=mysql --mysql-table-engine=innodb --mysql-host=192.168.177.130 --mysql-port=3306 --mysql-db=testdb --mysql-user='root' --mysql-password='123456' --test=/usr/share/sysbench/tests/include/oltp_legacy/oltp.lua --oltp-table-size=500000 --oltp-tables-count=8 --num-threads=4 --max-time=1800 --max-requests=0 --report-interval=1 run
WARNING: the --test option is deprecated. You can pass a script name or path on the command line without any options.
WARNING: the --test option is deprecated. You can pass a script name or path on the command line without any options.
WARNING: --num-threads is deprecated, use --threads instead
WARNING: --max-time is deprecated, use --time instead
sysbench 1.0.20 (using bundled LuaJIT 2.1.0-beta2)
Running the test with following options:
Number of threads: 4
Report intermediate results every 1 second(s)
Initializing random number generator from current time
Initializing worker threads...
Threads started!
[ 1s ] thds: 4 tps: 17.07 qps: 395.50 (r/w/o: 283.58/73.98/37.94) lat (ms,95%): 350.33 err/s: 0.00 reconn/s: 0.00
[ 2s ] thds: 4 tps: 25.89 qps: 526.10 (r/w/o: 367.65/106.67/51.78) lat (ms,95%): 314.45 err/s: 0.00 reconn/s: 0.00
[ 3s ] thds: 4 tps: 40.30 qps: 798.40 (r/w/o: 561.38/156.42/80.61) lat (ms,95%): 150.29 err/s: 0.00 reconn/s: 0.00
[ 4s ] thds: 4 tps: 46.25 qps: 910.32 (r/w/o: 633.86/185.01/91.45) lat (ms,95%): 196.89 err/s: 0.00 reconn/s: 0.00
[ 5s ] thds: 4 tps: 47.04 qps: 934.70 (r/w/o: 655.49/184.14/95.07) lat (ms,95%): 164.45 err/s: 0.00 reconn/s: 0.00
[ 6s ] thds: 4 tps: 33.97 qps: 691.36 (r/w/o: 483.55/139.87/67.94) lat (ms,95%): 227.40 err/s: 0.00 reconn/s: 0.00
[ 7s ] thds: 4 tps: 43.04 qps: 844.84 (r/w/o: 590.59/168.17/86.09) lat (ms,95%): 161.51 err/s: 0.00 reconn/s: 0.00
[ 8s ] thds: 4 tps: 35.92 qps: 734.32 (r/w/o: 514.83/147.66/71.84) lat (ms,95%): 179.94 err/s: 0.00 reconn/s: 0.00
[ 9s ] thds: 4 tps: 29.03 qps: 557.67 (r/w/o: 387.46/112.13/58.07) lat (ms,95%): 200.47 err/s: 0.00 reconn/s: 0.00
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/8520577/viewspace-2849779/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- sysbench 壓力測試
- sysbench壓測Oracle 12COracle
- sysbench壓測Oracle 11gOracle
- ClickHouse與Elasticsearch壓測實踐Elasticsearch
- NewSQL資料庫壓力測試工具系列——SysbenchSQL資料庫
- MySQL 5.7和8.0 MHA架構下sysbench壓測MySql架構
- MySQL 效能壓測工具-sysbench,從入門到自定義測試項MySql
- [資料庫]000 - ?Sysbench 資料庫壓力測試工具資料庫
- mysql之 sysbench1.0.3 安裝與系統壓力測試MySql
- 全鏈路壓測自動化實踐
- 京東物流常態化壓測實踐
- APP壓力測試6--monkeyrunner實踐APP
- sysbench 測試MySQLMySql
- 介面壓測實踐-壓力測試常見引數解釋說明
- 告別傳統壓測:全鏈路壓測在中通的實踐分享
- 「實操」適配 NebulaGraph 新版本與壓測實踐
- 使用sysbench壓力測試MySQL(一)(r11筆記第3天)MySql筆記
- sysbench fileio 壓測磁碟raid 5 raid 1 raid10 raid 50 情況AI
- 高德全鏈路壓測——精準控壓的建設實踐
- 一次效能壓測及分析調優實踐
- 壓力測試redis redis-benchmark 優化實踐Redis優化
- K6 在 Nebula Graph 上的壓測實踐
- 每秒 50 萬行——MySQL 寫入壓測併發實踐MySql
- [轉帖]sysbench基準測試
- 壓測怎麼做?如何自動化?盤點各大公司全鏈路壓測方案與實踐
- 全鏈路壓測平臺(Quake)在美團中的實踐
- 全鏈路壓測體系建設方案的思考與實踐
- 千萬級約課系統自動化壓測實踐 - 甯浩然
- 使用 Sysbench 進行 Linux 效能測試Linux
- 通過sysbench工具實現MySQL資料庫的效能測試MySql資料庫
- sysbench
- 資料庫基準測試工具 sysbench資料庫
- mysql ,tidb sysbench 測試結果記錄MySqlTiDB
- 資料庫效能測試:sysbench用法詳解資料庫
- 利用sysbench進行MySQL OLTP基準測試MySql
- 使用sysbench測試mysql及postgresql(完整版)MySql
- sysbench for dm
- 阿里巴巴在開源壓測工具 JMeter 上的實踐和最佳化阿里JMeter