国产成人精品18p,天天干成人网,无码专区狠狠躁天天躁,美女脱精光隐私扒开免费观看

mysql sysben0.5的安裝和測試步驟

發(fā)布時(shí)間:2021-09-14 18:07 來(lái)源:億速云 閱讀:0 作者:chen 欄目: Mysql 歡迎投稿:712375056

這篇文章主要介紹“ sysben0.5的安裝和測試步驟”,在日常操作中,相信很多人在mysql sysben0.5的安裝和測試步驟問(wèn)題上存在疑惑,小編查閱了各式資料,整理出簡(jiǎn)單好用的操作方法,希望對大家解答”mysql sysben0.5的安裝和測試步驟”的疑惑有所幫助!接下來(lái),請跟著(zhù)小編一起來(lái)學(xué)習吧!

安裝sysbench 

OS readhat 6.4

mysql版本5.7

mysql安裝目錄

下載安裝包 https://github.com/akopytov/sysbench

shell> wget https://github.com/akopytov/sysbench/archive/1.0.zip -O "sysbench-1.0.zip"

2. 安裝依賴(lài)包 

# yum -y install  make automake libtool pkgconfig libaio-devel vim-common

3、上傳到linux系統中(/usr/local/),并且解壓,進(jìn)入/usr/local/執行:

p unzip sysbench-0.5.zip -d  /usr/local

4、創(chuàng )建sysbench安裝目錄文件夾:

5、進(jìn)入/usr/local/sysbench-master/執行:./autogen.sh

# cd /usr/local/sysbench-0.5

# ./autogen.sh

6.

#./configure --prefix=/usr/local/sysbench-0.5 --with-mysql-includes=/usr/local/mysql/include --with-mysql-libs=/usr/local/mysql/lib/;

7.

#  make

8.

# make install

9.查看版本

[root@msyqlzhu sysbench-0.5]# /usr/local/sysbench-0.5/bin/sysbench version

sysbench 0.5

如果出現:(sysbench: error while loading shared libraries: libmysqlclient.so.20: cannot open shared object file: No such file or directory)報錯,

則在(vim /etc/profile 中加入:export LD_LIBRARY_PATH=/usr/local/mysql/lib/)

常用參數: 

#-test=tests/db/oltp.lua 表示調用 tests/db/oltp.lua 腳本進(jìn)行 oltp 模式測試

#--oltp_tables_count=10 表示會(huì )生成 10 個(gè)測試表

#--oltp-table-size=100000 表示每個(gè)測試表填充數據量為 100000 

#--rand-init=on 表示每個(gè)測試表都是用隨機數據來(lái)填充的

#-num-threads=8 表示發(fā)起 8個(gè)并發(fā)連接

#--oltp-read-表示不要進(jìn)行只讀測試,也就是會(huì )采用讀寫(xiě)混合模式測試

#--report-interval=10 表示每10秒輸出一次測試進(jìn)度報告

#--rand-type=uniform 表示隨機類(lèi)型為固定模式,其他幾個(gè)可選隨機模式:uniform(固定),gaussian(高斯),special(特定的),pareto(帕累托)

#--max-time=120 表示最大執行時(shí)長(cháng)為 120秒

#--max-requests=0 表示總請求數為 0,因為上面已經(jīng)定義了總執行時(shí)長(cháng),所以總請求數可以設定為 0;也可以只設定總請求數,不設定最大執行時(shí)長(cháng)

#--percentile=99 表示設定采樣比例,默認是 95%,即丟棄1%的長(cháng)請求,在剩余的99%里取最大值

測試文件IO

測試cpu的CPU測試使用64位整數,測試計算素數直到某個(gè)最大值所需要的時(shí)間。

# /usr/local/sysbench-0.5/bin/sysbench --test=cpu --cpu-max-prime=20000 run

 General statistics:

    total time:                          26.8631s

    total number of events:              10000

    total time taken by event execution: 26.8434s

    response time:

         min:                                  2.24ms

         avg:                                  2.68ms

         max:                                  7.49ms

         approx.  95 percentile:               3.20ms

Threads fairness:

    events (avg/stddev):           10000.0000/0.00

    execution time (avg/stddev):   26.8434/0.00

1.測試線(xiàn)程

[root@msyqlzhu t]# /usr/local/sysbench-0.5/bin/sysbench --test=threads --num-threads=64 run 

sysbench 0.5:  multi-threaded system evaluation benchmark

Running the test with following options:

Number of threads: 64

Random number generator seed is 0 and will be ignored

Initializing worker threads...

Threads started!

General statistics:

    total time:                          5.2132s

    total number of events:              10000

    total time taken by event execution: 332.6492s

    response time:

         min:                                  0.23ms

         avg:                                 33.26ms

         max:                                282.98ms

         approx.  95 percentile:              87.66ms

Threads fairness:

    events (avg/stddev):           156.2500/5.53

    execution time (avg/stddev):   5.1976/0.01

2.互斥鎖測試互斥鎖(mutex)

/usr/local/sysbench-0.5/bin/sysbench --test=mutex --num-threads=16 --mutex-num=2048 --mutex-locks=1000000 --mutex-loops=5000 run

sysbench 0.5:  multi-threaded system evaluation benchmark

Running the test with following options:

Number of threads: 16

Random number generator seed is 0 and will be ignored

Initializing worker threads...

Threads started!

General statistics:

    total time:                          2.5536s

    total number of events:              16

    total time taken by event execution: 39.6446s

    response time:

         min:                               2348.59ms

         avg:                               2477.79ms

         max:                               2553.24ms

         approx.  95 percentile:            2549.79ms

Threads fairness:

    events (avg/stddev):           1.0000/0.00

    execution time (avg/stddev):   2.4778/0.07

3.內存測試

 [root@msyqlzhu ~]# /usr/local/sysbench-0.5/bin/sysbench --test=memory --memory-block-size=8K --memory-total-size=1G  --num-threads=16 run

4. 文件IO基準測試

 共1G

 [root@msyqlzhu ~]# /usr/local/sysbench-0.5/bin/sysbench --test=fileio --file-total-size=1G prepare

 1073741824 bytes written in 8.15 seconds (125.60 MB/sec).

 測試文件IO 4個(gè)文件共4G

 [root@msyqlzhu ~]#  /usr/local/sysbench-0.5/bin/sysbench --test=fileio --file-num=4 --file-total-size=4G prepare

 4261412864 bytes written in 6.52 seconds (623.68 MB/sec).

 測試文件IO 4個(gè)文件共4G.塊大小為16K

 [root@msyqlzhu ~]#  /usr/local/sysbench-0.5/bin/sysbench --test=fileio --file-num=4 --file-block-size=16384 --file-total-size=4G prepare

這個(gè)命令會(huì )在當前工作目錄下創(chuàng )建測試文件,后續的運行(run)階段將通過(guò)讀寫(xiě)這些文件進(jìn)行測試。 第二步就是運行(run)階段,針對不同的IO 類(lèi)型有不同的測試選項:

seqwr 順序寫(xiě)入

seqrewr 順序重寫(xiě)

seqrd 順序讀取

rndrd 隨機讀取

rndwr 隨機寫(xiě)入

rndrw 混合隨機讀/寫(xiě)

下面的命令運行文件I/O混合隨機讀/寫(xiě)基準測試:

混合隨機讀/寫(xiě)

/usr/local/sysbench-0.5/bin/sysbench --test=fileio --file-total-size=4G --file-test-mode=rndrw  --init-rng=on --max-time=300 --max-requests=0 run

清除測試的文件

/usr/local/sysbench-0.5/bin/sysbench --test=fileio --fil-total-size=30G cleanup

測試oltp

1.找到select.lua腳本路徑

[root@msyqlzhu t]# find / -name oltp.lua

/usr/local/sysbench-0.5/sysbench/tests/db/oltp.lua

2.創(chuàng )建測試的時(shí)候默認用sbtest庫

> create database sbtest;

3.prepare生成數據和表

使用的參數

--oltp-table-size 生成的表的記錄數

--oltp-tables-count生成的表的個(gè)數

# /usr/local/sysbench-0.5/bin/sysbench --test=/usr/local/sysbench-0.5/sysbench/tests/db/oltp.lua  --oltp-table-size=100000  --mysql-user=root --oltp-tables-count=10 --mysql-password=ORACLE --mysql-socket=/mysqldata/mysql/data/mysql.sock prepare

4.run運行

也可使用parallel_prepare.lua腳本并行準備測試數據, 

運行時(shí)使用的參數

--oltp-dist-pct 熱點(diǎn)數據的比例

--oltp-dist-res 熱點(diǎn)數據訪(fǎng)問(wèn)頻率

--num-threads   線(xiàn)程數

--max-time=3000   執行時(shí)間

--report-interval  打印報告的時(shí)間間隔

# /usr/local/sysbench-0.5/bin/sysbench --test=/usr/local/sysbench-0.5/sysbench/tests/db/oltp.lua --num-threads=20 --oltp-dist-pct=1  --oltp-dist-res=75 --oltp-table-size=100000  --num-threads=100 --mysql-db=sbtest  --mysql-user=root --oltp-tables-count=10 --max-time=3000 --max-requests=0 --report-interval=3 --mysql-password=ORACLE  --mysql-socket=/mysqldata/mysql/data/mysql.sock run

生成的報告,tps:約為495,響應時(shí)間response time約為380毫秒,qps約為6千多

[ 141s] threads: 100, tps: 481.38, reads: 6728.28, writes: 2001.18, response time: 369.82ms (95%), errors: 0.33, reconnects:  0.00

[ 144s] threads: 100, tps: 495.94, reads: 6958.09, writes: 1970.41, response time: 339.89ms (95%), errors: 0.00, reconnects:  0.00

[ 147s] threads: 100, tps: 513.72, reads: 7193.10, writes: 2076.22, response time: 326.33ms (95%), errors: 0.33, reconnects:  0.00

[ 150s] threads: 100, tps: 494.33, reads: 6921.66, writes: 1971.33, response time: 333.44ms (95%), errors: 0.33, reconnects:  0.00

[ 153s] threads: 100, tps: 441.32, reads: 6032.87, writes: 1685.30, response time: 396.06ms (95%), errors: 0.00, reconnects:  0.00

[ 156s] threads: 100, tps: 502.62, reads: 7007.69, writes: 2000.82, response time: 398.92ms (95%), errors: 0.00, reconnects:  0.00

[ 159s] threads: 100, tps: 428.68, reads: 6192.48, writes: 1805.71, response time: 365.53ms (95%), errors: 0.00, reconnects:  0.00

[ 162s] threads: 100, tps: 438.70, reads: 6140.14, writes: 1777.47, response time: 586.58ms (95%), errors: 0.33, reconnects:  0.00

[ 165s] threads: 100, tps: 495.63, reads: 6928.11, writes: 1951.51, response time: 380.04ms (95%), errors: 0.00, reconnects:  0.00

5.clearnup

# /usr/local/sysbench-0.5/bin/sysbench --test=/usr/local/sysbench-0.5/sysbench/tests/db/oltp.lua  --oltp-table-size=100000 --mysql-db=sbtest --mysql-user=root --oltp-tables-count=10 --mysql-password=ORACLE --mysql-socket=/mysqldata/mysql/data/mysql.sock cleanup

測試select 

1.prepare生成數據

# /usr/local/sysbench-0.5/bin/sysbench --test=/usr/local/sysbench-0.5/sysbench/tests/db/select.lua  --oltp-table-size=10000000  --mysql-user=root --oltp-tables-count=10 --mysql-password=ORACLE --mysql-socket=/mysqldata/mysql/data/mysql.sock prepare

2.run運行

運行時(shí)使用的參數

--oltp-dist-pct 熱點(diǎn)數據的比例

--oltp-dist-res 熱點(diǎn)數據訪(fǎng)問(wèn)頻率

--num-threads   線(xiàn)程數

--max-time=3000   執行時(shí)間

--report-interval  打印報告的時(shí)間間隔

打印的報告種的reads表示qps,response time表示響應時(shí)間

# /usr/local/sysbench-0.5/bin/sysbench --test=/usr/local/sysbench-0.5/sysbench/tests/db/select.lua --num-threads=20 --oltp-dist-pct=1  --oltp-dist-res=75 --oltp-table-size=100000  --num-threads=10 --mysql-db=sbtest  --mysql-user=root --oltp-tables-count=10 --max-time=3000 --max-requests=0 --report-interval=3 --mysql-password=ORACLE  --mysql-socket=/mysqldata/mysql/data/mysql.sock run

[  84s] threads: 100, tps: 0.00, reads: 22529.11, writes: 0.00, response time: 0.14ms (95%), errors: 0.00, reconnects:  0.00

[  87s] threads: 100, tps: 0.00, reads: 22455.45, writes: 0.00, response time: 0.14ms (95%), errors: 0.00, reconnects:  0.00

[  90s] threads: 100, tps: 0.00, reads: 22569.36, writes: 0.00, response time: 0.13ms (95%), errors: 0.00, reconnects:  0.00

[  93s] threads: 100, tps: 0.00, reads: 21957.72, writes: 0.00, response time: 0.15ms (95%), errors: 0.00, reconnects:  0.00

[  96s] threads: 100, tps: 0.00, reads: 21588.06, writes: 0.00, response time: 0.14ms (95%), errors: 0.00, reconnects:  0.00

cleanup

# /usr/local/sysbench-0.5/bin/sysbench --test=/usr/local/sysbench-0.5/sysbench/tests/db/select.lua --oltp-dist-pct=1  --oltp-dist-res=75 --oltp-table-size=100000  --num-threads=10 --mysql-db=sbtest  --mysql-user=root --oltp-tables-count=10 --mysql-password=ORACLE  --mysql-socket=/mysqldata/mysql/data/mysql.sock cleanup

常用參數:

Run的時(shí)候常用的參數

–oltp-tables-count

–oltp-read-only 僅執行SELECT測試 on | off,默認為off

–oltp-dist-type 隨機數分布狀態(tài)。uniform(均勻分布)、gauss(高斯分布)、special(特殊分布)

–oltp-dist-pct 特殊分布的百分比值

–oltp-dist-res 特殊分布的百分比

–oltp-point-selects 單個(gè)事務(wù)中指定的selec查詢(xún)個(gè)數

–oltp-range-size 范圍查詢(xún)的范圍大小,該值應比oltp-table-size小

–oltp-simple-ranges 單個(gè)事務(wù)中指定的簡(jiǎn)單范圍查詢(xún)個(gè)數

–oltp-sum-ranges 單個(gè)事務(wù)中指定的SUM范圍查詢(xún)個(gè)數

–oltp-order-ranges 單個(gè)事務(wù)中指定的ORDER范圍查詢(xún)個(gè)數

–oltp-distinct-ranges 單個(gè)事務(wù)中指定的DISTINCT范圍查詢(xún)個(gè)數

–oltp-index-updates 單個(gè)事務(wù)中指定的使用索引更新的個(gè)數

–oltp-non-index-updates 單個(gè)事務(wù)中指定的不使用索引更新的個(gè)數

免責聲明:本站發(fā)布的內容(圖片、視頻和文字)以原創(chuàng )、來(lái)自本網(wǎng)站內容采集于網(wǎng)絡(luò )互聯(lián)網(wǎng)轉載等其它媒體和分享為主,內容觀(guān)點(diǎn)不代表本網(wǎng)站立場(chǎng),如侵犯了原作者的版權,請告知一經(jīng)查實(shí),將立刻刪除涉嫌侵權內容,聯(lián)系我們QQ:712375056,同時(shí)歡迎投稿傳遞力量。

国产成人夜色在线影院| 日产又大又黄又爽又猛| 亚洲AV综合AV一区二区三区| 国产成人精品午夜福利在线播放| 婷婷四房色播| 国产乱子伦精品免费视频|