Sysbench Testing Server Performance

Source: Internet
Author: User

Sysbench currently has a version of 0.5, but the most common use is still 0.4.12, so we'll take the 0.4.12 version as a test.

STEP1: Download and install Sysbench

wgethttp//pkgs.fedoraproject.org/repo/pkgs/sysbench/sysbench-0.4.12.tar.gz/3a6d54fdd3fe002328e4458206392b9d/ Sysbench-0.4.12.tar.gzTarZXVF sysbench-0.4. A.Tar. GZYum Installlibtool.x86_64 openssl-devel.x86_64 openssl-STATIC.X86_64CD Sysbench-0.4. A/libtoolize--force--copy./autogen.SH./Configure--prefix=/usr/local/sysbench Make Make Install

STEP2: Execute the test script (please do not paste this script directly to your machine unless you know what it is doing):

[Email protected] data]#CatSysbench_all.SH #!/bin/Bashresult_dir='/data/result'Io_file_dir='/data/iotest'if[ ! -d $result _dir]; Then    mkdir$result _dirfi#------------------------------FileIO Test-----------------------------------# # #RAND WRITE1- -Threadif[ ! -d $io _file_dir]; Then   mkdir$io _file_dirfiCD $io _file_dir#sysbench--test=fileio--file-TOTAL-SIZE=256G--file-num= -prepare#Sleep Ten forRwtypeinchseqwr seqrewr seqrd rndrd rndwr rndrw; Do   forNumthreadinch 1 2 4 8 Ten  -  -  +  +;  DoSysbench--test=fileio--file-TOTAL-SIZE=256G--file-test-mode= $rwtype--max- Time= ---max-requests=0--file-BLOCK-SIZE=4K--file-num= ---num-threads= $numthread run >> $result _dir/Io_${rwtype}_thread${numthread}.txt; Sleep Ten;  Done Done#-----------------------------CPU Test-------------------------------- foreachinch 1`seq 2 2  +`;  DoSysbench--test=cpu--cpu-max-prime=40000--num-threads= $each run >> $result _dir/Cpu_thread$each.txt; Sleep Ten Done#------------------------------RAM Test--------------------------------#  forRead foreachinch 1`seq 2 4  +`;  DoSysbench--test=memory--memory-block-size=4k--memory-scope=global--memory-total-size=256g--memory-oper=read-- num-threads= $each run >> $result _dir/Ramread_thread$each.txt; Sleep Ten ;  Done# for Write foreachinch 1`seq 2 4  +`;  DoSysbench--test=memory--memory-block-size=4k--memory-scope=global--memory-total-size=256g--memory-oper=Write--num-threads= $each run >> $result _dir/Ramwrite_thread$each.txt; Sleep Ten;  Done#--------------------------MySQL Test------------------------------# start Mysqlmysqld_safe--defaults-file=/DATA/MYSQL/MY3306.CNF &#waitMySQL startup completelySleep  -#prepare10000000is 2g#sysbench--TEST=OLTP--db-driver=mysql--mysql-host=127.0.0.1--mysql-user=root--mysql-password=123--mysql-db=t_sysbench--oltp-table-size=10000000--num-threads= +prepare# only Read foreachinch 1 4 8  -  -  +  +; DoSysbench--TEST=OLTP--oltp-table-size=10000000--db-driver=mysql--mysql-host=127.0.0.1--mysql-db=t_sysbench--mysql-user=root--mysql-password=123--max- Time= the--oltp-read-only=on--max-requests=0--num-threads= $each run >> $result _dir/Mysql_read_thread$each.txtSleep  - Done#read andWrite foreachinch 1 4 8  -  -  +  +; DoSysbench--TEST=OLTP--oltp-table-size=10000000--db-driver=mysql--mysql-host=127.0.0.1--mysql-db=t_sysbench--mysql-user=root--mysql-password=123--max- Time= the--max-requests=0--num-threads= $each run >> $result _dir/Mysql_rw_thread$each.txtSleep  - DoneMysqldadmin-uroot-p123-h127.0.0.1Shutdown

STEP3: Analysis and processing, need to use a similar to the following processing analysis script (to analyze MySQL as an example)

[Email protected] result]#awk-F'[():]' '/number of threads:/{printf $ "T"}/transactions:/{printf $ "\ T"}/deadlocks:/{printf $ "\ T"}/read\/write reques  ts:/{printf $ "\ T"}/approx. percentile:/{printf "\ n"}'mysql_rw_thread* |Sort-K1-N1    403.66Per Sec.0          7669.51Per Sec.2. 83ms4    1409.01Per Sec.0          26771.12Per Sec.3. 20ms8    2704.40Per Sec.3          51383.70Per Sec.3. 30ms -    4032.52Per Sec.8          76618.00Per Sec.4. 51ms -    4504.20Per Sec. A         85580.07Per Sec.5. 29ms +    5549.82Per Sec. -         105447.54Per Sec.8. 58ms +    5920.90Per Sec.108        112499.04Per Sec. One.54ms

Reference resources:

Https://wiki.mikejung.biz/Sysbench

Sysbench Testing Server Performance

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.