91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

Sysbench基準測試的示例分析

發布時間:2021-11-01 09:34:23 來源:億速云 閱讀:135 作者:小新 欄目:MySQL數據庫

這篇文章給大家分享的是有關Sysbench基準測試的示例分析的內容。小編覺得挺實用的,因此分享給大家做個參考,一起跟隨小編過來看看吧。

Sysbench和TPCC-MySQL一樣,也是一款基準測試的工具。

TPCC-MySQL
http://blog.itpub.net/29254281/viewspace-1195589/

相對于TPCC-MySQL,Sysbench不僅可以對MySQL,也可以對Oracle,PostgreSQL進行基準測試。

源碼下載地址:
https://launchpad.net/sysbench

先下載依賴包
yum install automake autoconf -y

運行./configure && make 命令,可能有以下的報錯
../libtool: line 5172: : command not found
修改configure.ac文件
Sysbench基準測試的示例分析

將LIBTOOL注釋,并增加AC_PROG_RANLIB
Sysbench基準測試的示例分析

修改之后運行如下命令
./autogen.sh && ./configure && make
完成之后,進入sysbench文件夾,可以看到sysbench命令已經編譯完成。

1.進行文件IO測試
準備文件
Sysbench基準測試的示例分析
進行基準測試

  1. [root@mysql1 sysbench]# ./sysbench --test=fileio --file-total-size=2G --file-test-mode=rndrw --file-num=16 --num-threads=16 run

  2. sysbench 0.4.12:  multi-threaded system evaluation benchmark


  3. Running the test with following options:

  4. Number of threads: 16


  5. Extra file open flags: 0

  6. 16 files, 128Mb each

  7. 2Gb total file size

  8. Block size 16Kb

  9. Number of random requests for random IO: 10000

  10. Read/Write ratio for combined random IO test: 1.50

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

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

  13. Using synchronous I/O mode

  14. Doing random r/w test

  15. Threads started!

  16. Done.


  17. Operations performed:  6006 Read, 3996 Write, 1600 Other = 11602 Total

  18. Read 93.844Mb  Written 62.438Mb  Total transferred 156.28Mb  (2.1231Mb/sec)

  19. 135.88 Requests/sec executed


  20. Test execution summary:

  21. total time:                          73.6086s

  22. total number of events:              10002

  23. total time taken by event execution: 602.0152

  24. per-request statistics:

  25. min:                                  0.01ms

  26. avg:                                 60.19ms

  27. max:                               1587.11ms

  28. approx.  95 percentile:             290.98ms


  29. Threads fairness:

  30. events (avg/stddev):           625.1250/42.01

  31. execution time (avg/stddev):   37.6259/2.94

其中主要參數和默認值
  --file-num=N                     創建測試的文件數量 [128]
  --file-block-size=N             塊的尺寸,默認是16K 用于測試Oracle一般改為8K[16384]        
  --file-total-size=SIZE         所有測試文件總的大小[2G]
  --file-test-mode=STRING   測試模式 seqwr(順序寫), seqrewr(順序讀寫), seqrd(順序讀), rndrd(隨機讀), rndwr(隨機寫), rndrw(隨機讀寫)
  --file-io-mode=STRING      文件操作模式 sync(同步),async(異步),fastmmap,slowmmap(兩種內存映射模式) [sync]
  --file-rw-ratio=N                測試時的讀寫比例  [1.5]

  --file-async-backlog=N        number of asynchronous operatons to queue per thread [128]
  --file-extra-flags=STRING     additional flags to use on opening files {sync,dsync,direct} []
  --file-fsync-freq=N           do fsync() after this number of requests (0 - don't use fsync()) [100]
  --file-fsync-all=[on|off]     do fsync() after each write operation [off]
  --file-fsync-end=[on|off]     do fsync() at the end of test [on]
  --file-fsync-mode=STRING      which method to use for synchronization {fsync, fdatasync} [fsync]
  --file-merged-requests=N      merge at most this number of IO requests if possible (0 - don't merge) [0]
 
測試完成之后清理生成的文件
[root@mysql1 sysbench]# ./sysbench --test=fileio --file-num=16 --file-total-size=2G cleanup
sysbench 0.4.12:  multi-threaded system evaluation benchmark
Removing test files...

如果出現如下錯誤,則需要注意 指定的file-num能夠被file-total-size 整除
FATAL: Too large position discovered in request!

2.進行CPU基準測試
[root@mysql1 sysbench]# ./sysbench --test=cpu --num-threads=16 run
sysbench 0.4.12:  multi-threaded system evaluation benchmark
Running the test with following options:
Number of threads: 16
Doing CPU performance benchmark
Threads started!
Done.
Maximum prime number checked in CPU test: 10000
Test execution summary:
    total time:                          2.5106s
    total number of events:              10000
    total time taken by event execution: 39.3201
    per-request statistics:
         min:                                  0.30ms
         avg:                                  3.93ms
         max:                                 43.80ms
         approx.  95 percentile:              15.07ms

Threads fairness:
    events (avg/stddev):           625.0000/50.60
    execution time (avg/stddev):   2.4575/0.03

3.OLTP基準測試
進行準備
[root@mysql1 sysbench]# ./sysbench --test=oltp --mysql-table-engine=innodb --oltp-table-size=1000000 --mysql-host=127.0.0.1 --mysql-user=xx --mysql-password=xx --mysql-socket=/home/lihuilin/mysql-5.6.14/mysql.sock  --num-threads=15  prepare
sysbench 0.4.12:  multi-threaded system evaluation benchmark

No DB drivers specified, using mysql
Creating table 'sbtest'...
Creating 1000000 records in table 'sbtest'...

然后進行測試
[root@mysql1 sysbench]# ./sysbench --test=oltp --mysql-table-engine=innodb --oltp-table-size=1000000 --mysql-host=127.0.0.1 --mysql-user=xx --mysql-password=xx --mysql-socket=/home/lihuilin/mysql-5.6.14/mysql.sock  --num-threads=15  run
sysbench 0.4.12:  multi-threaded system evaluation benchmark

No DB drivers specified, using mysql
Running the test with following options:
Number of threads: 15

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  (502.61 per sec.)
    deadlocks:                           0      (0.00 per sec.)
    read/write requests:                 190000 (9549.53 per sec.)
    other operations:                    20000  (1005.21 per sec.)

Test execution summary:
    total time:                          19.8963s
    total number of events:              10000
    total time taken by event execution: 298.1265
    per-request statistics:
         min:                                 11.62ms
         avg:                                 29.81ms
         max:                                185.70ms
         approx.  95 percentile:              42.60ms

Threads fairness:
    events (avg/stddev):           666.6667/5.69
    execution time (avg/stddev):   19.8751/0.01

相對于TPCC-MySQL,sysbench的測試結果非常直觀, 一目了然

感謝各位的閱讀!關于“Sysbench基準測試的示例分析”這篇文章就分享到這里了,希望以上內容可以對大家有一定的幫助,讓大家可以學到更多知識,如果覺得文章不錯,可以把它分享出去讓更多的人看到吧!

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

北安市| 太保市| 浮梁县| 南丰县| 张家港市| 论坛| 镇巴县| 田阳县| 呼和浩特市| 格尔木市| 美姑县| 张北县| 墨脱县| 黄山市| 普兰县| 黑龙江省| 连平县| 唐山市| 修水县| 化州市| 安宁市| 石景山区| 仙游县| 汝南县| 拉萨市| 陆良县| 那坡县| 沾化县| 邳州市| 黄大仙区| 阿拉善右旗| 饶平县| 汾西县| 深州市| 皮山县| 祥云县| 绥棱县| 德令哈市| 湖口县| 泾源县| 辽宁省|