MySQL Performance Test-Sysbench practice

Source: Internet
Author: User

MySQL Performance Test-Sysbench practice
Sysbench

  • Industry-renowned performance testing tools
  • Allows you to test disks, CPUs, and databases.
  • Supports multiple databases: Oracle, DB2, and MYSQL
  • Download, compile, and install the SDK by yourself.
  • Recommended version: sysbench0.5
Sysbench is used not only to test the database performance, but also to test the performance of the server running the database. We strongly recommend that you familiarize yourself with sysbench testing. This should be one of the most useful tools in the mysql user's toolkit.
  • Sysbench cpu Benchmark Test
  • Sysbench file I/O Benchmark Test
  • Sysbench OLTP Benchmark
Other benchmark tests of sysbench are not directly related to database performance.
  • Memory ----- test the continuous read/write performance of the memory
  • Thread ----- test the performance of the thread scheduler.
  • Mutex lock-test the performance of the mutex lock.
  • Sequential write-test the performance of sequential write.
Problem:
  • Single Table Structure
  • No constraints or Indexes
  • The tested SQL statement is relatively simple.
Usage 1. Download sysbench
Git clone https://github.com/akopytov/sysbench directory structure root @ itcast01:/home/aiapple/sysbench # lsautogen. sh configure. ac install-sh missing README-WIN.txtChangeLog COPYING m4 mkinstalldirs sysbenchconfig doc Makefile. am README. md TODO
2. Compile and install
./autogen.sh./configure --prefix=/home/sysbenchmakemake install
3. sysbench Process
  • Initialize data (prepare)
  • Run)
  • Cleanup)
A) initialize data prepare:
sysbench --test=parallel_prepare.lua --oltp_tables_count=1 --rand-init=on --oltp-table-size=500000000 --mysql-host=127.0.0.1 --mysql-port=3306 --mysql-user=sys --mysql-password=netease --mysql-db=sbtest --max-requests=0 prepare
Sysbench table structure

B) run the test -- run

sysbench --test=oltp.lua --oltp_tables_count=1 --num-threads=100 --oltp-table-size=500000000 --oltp-read-only=off --report-interval=10 --rand-type=uniform --mysql-host=127.0.0.1 --mysql-port=3306 --mysql-user=sys --mysql-password=netease --mysql-db=sbtest --max-time=1000 --max-requests=0 run

Special Cases
  • Write test (insert only)
Data Interpretation running data [10 s] -------------- running time point Threads: 100------100 Threads tps: 378.90 --------- execute 378.9 transactions per second reads: ------------- Number of read requests writes: ------------ Write Request count response time: -- response time errors: ------------- error count reconnects: ------- reconnect count data summary follow
  • Response time
  • Tps

C) cleanup)

  • Manually drop tables and databases
  • Run the cleanup Command provided by sysbench.
Use sysbench to clear data
sysbench --test=parallel_prepare.lua --oltp_tables_count=1 --rand-init=on --oltp-table-size=500000000 --mysql-host=127.0.0.1 --mysql-port=3306 --mysql-user=sys --mysql-password=netease --mysql-db=sbtest --max-requests=0 cleanup 

This article permanently updates the link address:

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.