日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

mysql sysbench 教程_mysql sysbench 使用方法!

發(fā)布時間:2024/3/26 数据库 42 豆豆
生活随笔 收集整理的這篇文章主要介紹了 mysql sysbench 教程_mysql sysbench 使用方法! 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

mysql 壓力測試之sysbench

1.sysbench 的安裝

下載下來之后會有一個sysbench-0.4.10.tar.gz ?壓縮包.

解壓后生成目錄 sysbench-0.4.10

進入sysbench-0.4.10 這個目錄

[root@linuxvm01 home]# cd ?/home/sysbench-0.4.10

編譯安裝sysbench

[root@linuxvm01 sysbench-0.4.10]# ./configure --with-mysql-includes=/usr/include/mysql --with-mysql-libs=/usr/lib ?&& make && make install

checking build system type... x86_64-unknown-linux-gnu

checking host system type... x86_64-unknown-linux-gnu

checking target system type... x86_64-unknown-linux-gnu

checking for a BSD-compatible install... /usr/bin/install -c

checking whether build environment is sane... yes

checking for a thread-safe mkdir -p... /bin/mkdir -p

checking for gawk... gawk

TIP:

with-mysql-includes 指定上面確認的mysql-devel的路徑,

with-mysql-libs 是安裝mysql的路徑,

# ?當時這兩個參數(shù)沒弄明白編譯安裝的時候一直報錯,

安裝過程中出現(xiàn)的錯誤處理

(1).drv_mysql.c:32:19: error: mysql.h: No such file or directory

參數(shù) with-mysql-includes ,with-mysql-libs 不準確

(2)./usr/bin/ld: cannot find -lmysqlclient_r

collect2: ld returned 1 exit status

make[2]: *** [sysbench] Error 1

make[2]: Leaving directory `/home/sysbench-0.4.10/sysbench'

make[1]: *** [all-recursive] Error 1

make[1]: Leaving directory `/home/sysbench-0.4.10/sysbench'

make: *** [all-recursive] Error 1

安裝下:rpm -ivh ?MySQL-shared-5.6.22-1.el6.x86_64.rpm

2.sysbench 的使用

sysbench 可以測試的項目有

cpu的性能測試

內存性能測試

磁盤io吸能測試

oltp系統(tǒng)測試

最重要的還是 磁盤io吸能測試 和oltp 測試。

這里重點講解下磁盤io吸能測試 和oltp 測試。

=====磁盤io性能測試 ==============

IO測試分為三個階段, 文件生成,執(zhí)行測試,清理測試文件

首先生成需要測試的文件

sysbench --test=fileio --num-threads=2 --file-num=16 --file-total-size=30G --file-test-mode=rndrw --file-rw-ratio=2 prepare

[root@linuxvm01 ~]# sysbench --test=fileio --num-threads=2 --file-num=16 --file-total-size=30G --file-test-mode=rndrw --file-rw-ratio=2 prepare

sysbench 0.4.10: ?multi-threaded system evaluation benchmark

16 files, 1966080Kb each, 30720Mb total

Creating files for the test...

然后執(zhí)行測試

sysbench --test=fileio --num-threads=2 --file-num=16 --file-total-size=30G --file-test-mode=rndrw --file-rw-ratio=2 run

[root@linuxvm01 ~]# sysbench --test=fileio --num-threads=2 --file-num=16 --file-total-size=30G --file-test-mode=rndrw --file-rw-ratio=2 run

sysbench 0.4.10: ?multi-threaded system evaluation benchmark

Running the test with following options:

Number of threads: 2

Extra file open flags: 0

16 files, 1.875Gb each

30Gb total file size

Block size 16Kb

Number of random requests for random IO: 10000

Read/Write ratio for combined random IO test: 2.00

Periodic FSYNC enabled, calling fsync() each 100 requests.

Calling fsync() at the end of test, Enabled.

Using synchronous I/O mode

Doing random r/w test

Threads started!

Done.

Operations performed: ?6667 Read, 3333 Write, 1600 Other = 11600 Total

Read 104.17Mb ?Written 52.078Mb ?Total transferred 156.25Mb ?(2.0936Mb/sec)

133.99 Requests/sec executed

Test execution summary:

total time: ? ? ? ? ? ? ? ? ? ? ? ? ?74.6328s

total number of events: ? ? ? ? ? ? ?10000

total time taken by event execution: 142.3936

per-request statistics:

min: ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?0.01ms

avg: ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 14.24ms

max: ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?305.56ms

approx. ?95 percentile: ? ? ? ? ? ? ?37.48ms

Threads fairness:

events (avg/stddev): ? ? ? ? ? 5000.0000/12.00

execution time (avg/stddev): ? 71.1968/0.09

這個里面最重要的需要關注的吞吐量(2.0936Mb/sec) ,

每秒請求數(shù)( 133.99 Requests/sec executed)

還有95%的請求耗時( approx. ?95 percentile: ? ? ? ? ? ? ?37.48ms)

最后清理測試文件

sysbench --test=fileio --num-threads=2 --file-num=16 --file-total-size=30G --file-test-mode=rndrw --file-rw-ratio=2 cleanup

=====OLTP 系統(tǒng)性能測試 ==============

otlp性能測試分為兩階段.

1.準備階段

2.執(zhí)行階段

--準備階段

[root@linuxvm01 ~]# sysbench --test=oltp --mysql-table-engine=innodb --oltp-table-size=4000000 --mysql-socket=/var/lib/mysql/mysql.sock --mysql-db=test ?--mysql-user=root ?--mysql-password=anyu@2014 prepare

sysbench 0.4.10: ?multi-threaded system evaluation benchmark

No DB drivers specified, using mysql

Creating table 'sbtest'...

Creating 4000000 records in table 'sbtest'...

-- 執(zhí)行階段

[root@linuxvm01 ~]# sysbench --num-threads=8 --max-requests=4000000 --test=oltp --mysql-table-engine=innodb --oltp-table-size=4000000 --mysql-socket=/var/lib/mysql/mysql.sock --mysql-db=test --mysql-user=root ?--mysql-password=anyu@2014 run

sysbench 0.4.10: ?multi-threaded system evaluation benchmark

No DB drivers specified, using mysql

WARNING: Preparing of "BEGIN" is unsupported, using emulation

(last message repeated 7 times)

Running the test with following options:

Number of threads: 8

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 4000000

Threads started!

Done.

OLTP test statistics:

queries performed:

read: ? ? ? ? ? ? ? ? ? ? ? ? ? ?56000000

write: ? ? ? ? ? ? ? ? ? ? ? ? ? 20000000

other: ? ? ? ? ? ? ? ? ? ? ? ? ? 8000000

total: ? ? ? ? ? ? ? ? ? ? ? ? ? 84000000

transactions: ? ? ? ? ? ? ? ? ? ? ? ?4000000 (125.37 per sec.)

deadlocks: ? ? ? ? ? ? ? ? ? ? ? ? ? 0 ? ? ?(0.00 per sec.)

read/write requests: ? ? ? ? ? ? ? ? 76000000 (2381.99 per sec.)

other operations: ? ? ? ? ? ? ? ? ? ?8000000 (250.74 per sec.)

Test execution summary:

total time: ? ? ? ? ? ? ? ? ? ? ? ? ?31906.1255s

total number of events: ? ? ? ? ? ? ?4000000

total time taken by event execution: 255224.4528

per-request statistics:

min: ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?2.69ms

avg: ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 63.81ms

max: ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 5557.09ms

approx. ?95 percentile: ? ? ? ? ? ? 178.90ms

Threads fairness:

events (avg/stddev): ? ? ? ? ? 500000.0000/2282.56

execution time (avg/stddev): ? 31903.0566/0.09

這段輸出中包含了

QPS(transactions: ? ? ? ? ? ? ? ? ? ? ? ?4000000 (125.37 per sec.)) ,

tps( transactions: ? ? ? ? ? ? ? ? ? ? ? ?4000000 (125.37 per sec.))

百分之95的請求耗時在178.90ms : approx. ?95 percentile: ? ? ? ? ? ? 178.90ms

參考鏈接:

總結

以上是生活随笔為你收集整理的mysql sysbench 教程_mysql sysbench 使用方法!的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。

主站蜘蛛池模板: av在线不卡观看 | 91视频国产一区 | 国产三级精品视频 | 女优色图| 99热都是精品 | 狼色网 | av天天在线| 2021毛片| 丁香婷婷一区二区三区 | 午夜家庭影院 | 黑森林av | 中文字幕在线一 | 欧美成人黑人xx视频免费观看 | 视频免费在线观看 | 中文字幕第66页 | 国语av在线| www.色在线| 成人免费超碰 | 中文字幕在线国产 | www.好了av.com | 成人在线观看黄色 | 国产精品久久综合青草亚洲AV | 99久免费精品视频在线观78 | 91大奶| 99爱在线视频 | 成人性生生活性生交全黄 | 国产免费激情 | 99热只有这里有精品 | 中文字幕欧美在线观看 | 日日碰日日摸 | 免费av一级 | 黄色大片在线播放 | 欧美视频一区二区三区在线观看 | 顶级尤物极品女神福利视频 | 加勒比一区二区 | 日本性爱视频在线观看 | 午夜一级大片 | 玖玖伊人 | 色香蕉视频 | 婷婷俺也去| 日韩激情在线播放 | 激情片 | 美女在线网站 | 天天看黄色 | 久久久久香蕉视频 | 国产夫绿帽单男3p精品视频 | 久久天天躁狠狠躁夜夜躁 | 毛片视频免费观看 | 在线国产不卡 | 欧美日韩精品网站 | 经典杯子蛋糕日剧在线观看免费 | 日本视频在线观看免费 | 成人3d动漫一区二区三区 | 久久中文字幕av | 新天堂网 | 精品久久香蕉国产线看观看亚洲 | 小视频成人 | 亚洲免费av一区二区 | 手机看片福利永久 | 在线观看麻豆 | 精品日日夜夜 | 性色AV无码久久一区二区三 | 欧美久久久久久又粗又大 | 亚洲久爱| 日韩美女视频网站 | 欧美极品喷水 | www.我爱av| 国产黄色片在线观看 | 黑人vs日本人ⅹxxxhd | 国产农村妇女精品 | 中文字幕免费在线播放 | 欧美日韩一 | 国产中文在线 | 麻豆视频在线观看免费网站黄 | 久草久 | 丁香啪啪综合成人亚洲 | 亚洲图片自拍偷拍区 | 日本一区二区欧美 | 欧美黄色成人 | 日韩精品中文字幕一区二区 | 国产一级色 | 成人在线日韩 | 国产a级片视频 | 综合成人 | 手机在线免费av | 福利免费在线观看 | 亚洲永久免费 | 国产三级三级三级 | 亚洲毛片在线播放 | 在线观看黄网址 | 鲁一鲁在线 | 日韩精品毛片 | 亚洲论理 | 国产天堂资源 | 欧美精品18 | 亚洲青草视频 | 亚洲免费黄色片 | 91免费污视频| 伊人狼人影院 |