MySQL基準測試

來源:互聯網
上載者:User

標籤:style   blog   http   io   os   使用   ar   strong   for   

MySQL基準測試載入器

mysqlslap、sysbench、Super Smack

mysqlslap的使用MySQL官網給出了介紹

Super Smack是伺服器壓力測試強有力的工具

sysbench是MySQL基準測試載入器了

 

sysbench安裝

直接yum安裝

 

測試環境

mysql> SELECT VERSION();+-----------+| VERSION() |+-----------+| 5.1.73    |+-----------+1 row in set (0.00 sec)

  

1:測試CPU

[[email protected] ~]# sysbench --test=cpu --cpu-max-prime=1500 run

2:測試fileio

首先組建檔案用於測試(預設產生128個單個16M共2G的檔案)

[[email protected] ~]# sysbench --test=fileio prepare

讀寫檔案測試

[[email protected] ~]# sysbench --test=fileio --file-test-mode=rndrw run

每秒請求數:Requests/sec  1841.10

總體輸送量:28.767Mb/sec

刪除測試資料:

[[email protected] ~]# sysbench --test=fileio cleanup

  

3:測試oltp(主要用來測試多線程交易處理)

首先建立資料庫和測試表

mysql> CREATE DATABASE gechong;Query OK, 1 row affected (0.00 sec)mysql> CREATE TABLE test_oltp    -> SELECT * FROM mysql.user;ERROR 1046 (3D000): No database selectedmysql> USE gechong;Database changedmysql> CREATE TABLE test_oltp SELECT * FROM mysql.user;Query OK, 3 rows affected (0.01 sec)Records: 3  Duplicates: 0  Warnings: 0

  

[[email protected] ~]# sysbench --test=oltp --oltp-table-size=2000000 --oltp-table-name=test_oltp --mysql-db=gechong --mysql-user=root  --msyql-password=gechong prepareUnknown option: --msyql-password.

  

提示建立失敗了。

查看下協助

sysbench [general-options]... --test=<test-name> [test-options] ... command

General options:

--num-threads=N number of threads to use [1]
--max-requests=N limit for total number of requests [10000]
--max-time=N limit for total execution time in seconds [0]
--forced-shutdown=STRING amount of time to wait after --max-time before forcing shutdown [off]
--thread-stack-size=SIZE size of stack per thread [32K]
--init-rng=[on|off] initialize random number generator [off]
--test=STRING test to run
--debug=[on|off] print more debugging info [off]
--validate=[on|off] perform validation checks where possible [off]
--help=[on|off] print help and exit
--version=[on|off] print version and exit

 

Compiled-in tests:
fileio - File I/O test
cpu - CPU performance test
memory - Memory functions speed test
threads - Threads subsystem performance test
mutex - Mutex performance test
oltp - OLTP test

 

command

prepare/run/cleanup/help/version

 

查看協助

[[email protected] ~]# sysbench --help=on --test=<oltp> help

  

 

MySQL基準測試

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.