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

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

MySql性能测试工具-sysbench

發布時間:2024/3/26 编程问答 44 豆豆
生活随笔 收集整理的這篇文章主要介紹了 MySql性能测试工具-sysbench 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

轉自:MySql性能測試工具-sysbench — 沒那么簡單的博客

雖然mysql默認的有mysqlslap這個性能測試工具,但和sysbench比較來說,還遜色不少。

  • 下載安裝包 https://github.com/akopytov/sysbench
  • shell> wget https://github.com/akopytov/sysbench/archive/1.0.zip -O "sysbench-1.0.zip" shell> unzip sysbench-1.0.zip shell> cd sysbench-1.0
  • 安裝依賴庫
  • shell> yum install automake libtool -y
  • 開始安裝
  • shell> ./autogen.sh shell> ./configure #ERROR: cannot find MySQL libraries. If you want to compile with MySQL support 沒找到mysql庫 需要用參數指定下 --with-mysql-includes和--with-mysql-libs shell> ./configure --with-mysql-includes=/alidata/server/mysql5.7/include/ --with-mysql-libs=/alidata/server/mysql5.7/lib/ shell> make
  • 執行下命令:
  • shell> sysbench --help #sysbench: error while loading shared libraries: libmysqlclient.so.20: cannot open shared object file: No such file or directory #問題原因:sysbench無法找到mysql的庫文件,可能是環境變量LD_LIBRARY_PATH沒有設置,設置后即可解決該問題: shell> export LD_LIBRARY_PATH=/alidata/server/mysql5.7/lib/lib shell> sysbench --version sysbench 1.0
  • 創建測試數據庫sbtest
  • shell> mysqladmin create sbtest -uroot -p Enter password:
  • 測試準備: 20個并發連接,20張表 每個表填充10W條數據 最大請求時間120s
  • #-test=tests/db/oltp.lua 表示調用 tests/db/oltp.lua 腳本進行 oltp 模式測試 #--oltp_tables_count=10 表示會生成 10 個測試表 #--oltp-table-size=100000 表示每個測試表填充數據量為 100000 #--rand-init=on 表示每個測試表都是用隨機數據來填充的 #-num-threads=8 表示發起 8個并發連接 #--oltp-read-only=off 表示不要進行只讀測試,也就是會采用讀寫混合模式測試 #--report-interval=10 表示每10秒輸出一次測試進度報告 #--rand-type=uniform 表示隨機類型為固定模式,其他幾個可選隨機模式:uniform(固定),gaussian(高斯),special(特定的),pareto(帕累托) #--max-time=120 表示最大執行時長為 120秒 #--max-requests=0 表示總請求數為 0,因為上面已經定義了總執行時長,所以總請求數可以設定為 0;也可以只設定總請求數,不設定最大執行時長 #--percentile=99 表示設定采樣比例,默認是 95%,即丟棄1%的長請求,在剩余的99%里取最大值shell> sysbench --test=oltp --oltp_tables_count=10 --oltp-table-size=100000 --mysql-user=root --mysql-password=123456 --num-threads=20 --max-time=120 --max-requests=0 --oltp-test-mode=complex prepare sysbench 1.0: multi-threaded system evaluation benchmarkCreating table 'sbtest1'... Inserting 100000 records into 'sbtest1' Creating secondary indexes on 'sbtest1'... Creating table 'sbtest2'... Inserting 100000 records into 'sbtest2' Creating secondary indexes on 'sbtest2'... Creating table 'sbtest3'... Inserting 100000 records into 'sbtest3' Creating secondary indexes on 'sbtest3'... Creating table 'sbtest4'... Inserting 100000 records into 'sbtest4' Creating secondary indexes on 'sbtest4'... Creating table 'sbtest5'... Inserting 100000 records into 'sbtest5' Creating secondary indexes on 'sbtest5'... Creating table 'sbtest6'... Inserting 100000 records into 'sbtest6' Creating secondary indexes on 'sbtest6'... Creating table 'sbtest7'... Inserting 100000 records into 'sbtest7' Creating secondary indexes on 'sbtest7'... Creating table 'sbtest8'... Inserting 100000 records into 'sbtest8' Creating secondary indexes on 'sbtest8'... Creating table 'sbtest9'... Inserting 100000 records into 'sbtest9' Creating secondary indexes on 'sbtest9'... Creating table 'sbtest10'... Inserting 100000 records into 'sbtest10' Creating secondary indexes on 'sbtest10'...

    7.開始測試

    shell> sysbench --test=oltp --oltp_tables_count=10 --oltp-table-size=100000 --mysql-user=root --mysql-password=123456 --num-threads=20 --max-time=120 --max-requests=0 --oltp-test-mode=complex run >> /tmp/log/sysbench_oltpx_20161121.log#執行結束后查看測試報告 shell> less /tmp/log/sysbench_oltpx_20161121.log sysbench 1.0: multi-threaded system evaluation benchmark#報告內容如下: Running the test with following options: Number of threads: 20 Initializing random number generator from current timeInitializing worker threads...Threads started!OLTP test statistics:queries performed:read: 935592 --讀總數write: 267295 --寫總數other: 133650 --其他操作(CURD之外的操作,例如COMMIT)total: 1336537 --全部總數transactions: 66822 (556.77 per sec.) --總事務數(每秒事務數)read/write requests: 1202887 (10022.55 per sec.) --讀寫總數(每秒讀寫次數)other operations: 133650 (1113.58 per sec.) --其他操作總數(每秒其他操作次數)ignored errors: 6 (0.05 per sec.) --總忽略錯誤總數(每秒忽略錯誤次數)reconnects: 0 (0.00 per sec.) --重連總數(每秒重連次數)General statistics: --常規統計total time: 120.0180s --總耗時total number of events: 66822 --共發生多少事務數total time taken by event execution: 2399.7900s --所有事務耗時相加(不考慮并行因素)response time:min: 2.76ms --最小耗時avg: 35.91ms --平均耗時max: 1435.19ms --最長耗時approx. 95 percentile: 84.22ms --超過95%平均耗時Threads fairness: --并發統計events (avg/stddev): 3341.1000/37.54 --總處理事件數/標準偏差execution time (avg/stddev): 119.9895/0.02 --總執行時間/標準偏差

    總結

    以上是生活随笔為你收集整理的MySql性能测试工具-sysbench的全部內容,希望文章能夠幫你解決所遇到的問題。

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

    主站蜘蛛池模板: 亚洲av无码国产精品久久久久 | 色欧美88888久久久久久影院 | 免费在线观看av网站 | 91麻豆一区二区三区 | 91精品国产高潮对白 | 亚洲怡红院av| 992tv人人草| 亚洲精品无人区 | 国产欧美一区二区三区另类精品 | 亚洲一区二区三区在线看 | 官场艳妇疯狂性关系 | 在线观看国产免费视频 | 国产情侣一区二区三区 | 亚洲综合精品视频 | 日本不卡一区二区在线观看 | 视频一区 国产 | 国产99久久久久 | 黑人巨茎大战欧美白妇 | www.av777| 国产国语亲子伦亲子 | 不卡中文| 亚洲三级影视 | 国产特级视频 | 秋霞成人午夜鲁丝一区二区三区 | 性爱免费视频 | 中文字幕天堂网 | 毛片直接看 | 成人在线播放网站 | 97国产精品视频人人做人人爱 | 精品国产综合区久久久久久 | 奇米第四色7777 | 久久噜噜噜精品国产亚洲综合 | 亚洲综合一区中 | 超碰免费97 | 色综合免费视频 | 亚洲女人18毛片水真多 | 日本黄色a视频 | 日本人的性生活视频 | 成人妇女淫片aaaa视频 | 综合久久中文字幕 | 94av视频| 国产精品视频网址 | 91视频入口 | 日韩综合第一页 | 国产日韩欧美视频在线 | 日本人和亚洲人zjzjhd | 999午夜| 欧美成人女星 | 国产在线一区二 | 可以在线看的av | 国产欧美日韩一区二区三区 | 中国一区二区视频 | 爱爱爱网 | 精品人妻一区二区免费视频 | 人成免费 | 九草视频在线观看 | 国产无套内射又大又猛又粗又爽 | 欧美日韩免费看 | 国产最新在线观看 | 在线一区二区三区四区五区 | 日韩精品一级 | 国产吞精囗交免费视频网站 | 色欲av永久无码精品无码蜜桃 | 欧美成人视屏 | 日韩av一卡二卡 | 色呦呦免费 | 哺乳期喷奶水丰满少妇 | 国产裸体无遮挡 | 午夜动态图 | aaa天堂| 人妻精品一区二区三区 | 一区二区三区国产在线 | 强行挺进皇后紧窄湿润小说 | 91高清视频免费观看 | 簧片av| 三级黄色免费 | 成人国产精品入口免费视频 | 麻豆传媒网址 | av在线电影观看 | 亚洲男人第一天堂 | 成人日韩在线观看 | 免费一级片网站 | 午夜精品久久久久久久99热浪潮 | 涩涩视频在线 | 17c在线视频 | 亚洲美女屁股眼交 | 亚洲最新中文字幕 | 国产精品久久久久9999 | 大尺度做爰呻吟舌吻网站 | 啪啪小视频 | 久久伊人影视 | 国产免费观看一区 | 亚洲一区二区在线视频 | 综合狠狠开心 | 国产女同91疯狂高潮互磨 | 女人下边被添全过视频 | 国产喷水吹潮视频www | 亚洲经典视频 | 国产馆视频 |