CENTOS 7 踢用户_CentOS服务器及MySQL数据库性能测试-乐搏软件测试
這期小編和大家分享使用Sysbench,進(jìn)行CentOS服務(wù)器及MySQL數(shù)據(jù)庫的性能測(cè)試。
Sysbench是一個(gè)跨平臺(tái)的基準(zhǔn)測(cè)試工具。
基準(zhǔn)測(cè)試是對(duì)數(shù)據(jù)庫的性能指標(biāo)進(jìn)行定量的、可復(fù)現(xiàn)的、可對(duì)比的測(cè)試。
基準(zhǔn)測(cè)試可以理解為針對(duì)系統(tǒng)的一種壓力測(cè)試。
但基準(zhǔn)測(cè)試不關(guān)心業(yè)務(wù)邏輯
更加簡單、直接、易于測(cè)試,數(shù)據(jù)可以由工具生成,不要求真實(shí);
而壓力測(cè)試一般考慮業(yè)務(wù)邏輯(如訂單業(yè)務(wù))
要求真實(shí)的數(shù)據(jù)。
系統(tǒng)環(huán)境:CentOS 7.5
Q:所需軟件環(huán)境?
A:MariaDB-devel、MariaDB-client、MariaDB-server。
Q:所需軟件?
A:Sysbench。
初始化安裝環(huán)境
curl -s https://packagecloud.io/install/repositories/akopytov/sysbench/script.rpm.sh | sudo bash
初始化安裝環(huán)境
安裝sysbench
yum install sysbench -y
測(cè)試處理器性能
sysbench cpu --cpu-max-prime=100000 --threads=4
測(cè)試處理器性能
測(cè)試硬盤IO性能
–file-num 生成測(cè)試文件的數(shù)量,默認(rèn)是128
–file-block-size 測(cè)試期間文件塊的大小
–file-total-size 每個(gè)文件的大小,默認(rèn)是2GB
–file-test-mode 文件測(cè)試模式,
包含seqwr(順序?qū)?、seqrewr(順序讀寫)、seqrd(順序讀)、rndr d(隨即讀)、rndwr(隨機(jī)寫)、rndrw(隨機(jī)讀寫)
sysbench fileio --file-num=128 --file-block-size=16384 --file-total-size=2G --file-test-mode=seqwr --threads=4 run
測(cè)試內(nèi)存
--memory-block-size塊大小
--memory-total-size總大小
--memory-access-mode測(cè)試模式 seq順序模式,rnd隨機(jī)模式
sysbench memory --memory-block-size=1K --memory-total-size=4G --memory-access-mode=rnd --threads=4 run
測(cè)試內(nèi)存
測(cè)試數(shù)據(jù)庫
--oltp-test-mode 測(cè)試模式
--oltp-tables-count 建立表數(shù)
--oltp-table-size 表數(shù)據(jù)量大小
--threads 線程
--time 時(shí)間
--report-interval 反饋間隔時(shí)間
01
建立測(cè)試數(shù)據(jù)庫
sysbench ./oltp.lua --mysql-user=root --mysql-password=ljzlxyfwm --mysql-db=test --oltp-test-mode=complex --oltp-tables-count=10 --oltp-table-size=100000 --threads=150 --time=120 --report-interval=2 prepare
建立測(cè)試數(shù)據(jù)庫
02
測(cè)試數(shù)據(jù)庫性能
sysbench ./oltp.lua --mysql-user=root --mysql-password=ljzlxyfwm --mysql-db=test --oltp-test-mode=complex --oltp-tables-count=10 --oltp-table-size=100000 --thread=4 run
測(cè)試數(shù)據(jù)庫性能
03
清空測(cè)試數(shù)據(jù)庫
sysbench ./oltp.lua --mysql-user=root --mysql-password=ljzlxyfwm --mysql-db=test --oltp-test-mode=complex --oltp-tables-count=10 --oltp-table-size=100000 --thread=4 cleanup
清空測(cè)試數(shù)據(jù)庫
總結(jié)
以上是生活随笔為你收集整理的CENTOS 7 踢用户_CentOS服务器及MySQL数据库性能测试-乐搏软件测试的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 奈雪的茶创始人是谁哪里人 香港IPO
- 下一篇: jdbc驱动程序_JDBC操作数据库的步