Sysbench MySQL性能测试比较On SSD & SATA

机器硬件环境:

CPU: Intel(R) Xeon(R) CPU E3-1230 v3 @ 3.30GHz 4核

Mem: 32G

SSD: INTEL SSDSC2BP480G4

SATA HDD: 2*500G LVM

sysbench 0.5的安装:

#bzr branch lp:~sysbench-developers/sysbench/0.5  sysbench
#cd sysbench/
#./configure --prefix=/usr/local/sysbench0.5
#make && make install
然后拷贝编译好的源码至 /usr/local/src目录下
#cp -dprf sysbench /usr/local/src/

这里注意sysbench 0.5 --help选项中并未显示针对OLTP的帮助信息,如下:

[[email protected] bin]# /usr/local/sysbench0.5/bin/sysbench --help
Missing required command argument.
Usage:
  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 [64K]
  --tx-rate=N                 target transaction rate (tps) [0]
  --report-interval=N         periodically report intermediate statistics with a specified interval in seconds. 0 disables intermediate reports [0]
  --report-checkpoints=[LIST,...]dump full statistics and reset all counters at specified points in time. The argument is a list of comma-separated values representing the amount of time in seconds elapsed from start of test when report checkpoint(s) must be performed. Report checkpoints are off by default. []
  --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 [off]
  --rand-init=[on|off]        initialize random number generator [off]
  --rand-type=STRING          random numbers distribution {uniform,gaussian,special,pareto} [special]
  --rand-spec-iter=N          number of iterations used for numbers generation [12]
  --rand-spec-pct=N           percentage of values to be treated as ‘special‘ (for special distribution) [1]
  --rand-spec-res=N           percentage of ‘special‘ values to use (for special distribution) [75]
  --rand-seed=N               seed for random number generator, ignored when 0 [0]
  --rand-pareto-h=N           parameter h for pareto distibution [0.2]

Log options:
  --verbosity=N      verbosity level {5 - debug, 0 - only critical messages} [3]

  --percentile=N      percentile rank of query response times to count [95]

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

Commands: prepare run cleanup help version

See ‘sysbench --test=<name> help‘ for a list of options for each test.

还得看sysben0.4的相关帮助,如下:

[[email protected] bin]#/usr/local/sysbench0.4/bin/sysbench --help
Usage:
  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

Commands: prepare run cleanup help version

See ‘sysbench --test=<name> help‘ for a list of options for each test.

[[email protected] bin]# ./sysbench --test=oltp help
sysbench 0.4.12:  multi-threaded system evaluation benchmark

oltp options:
  --oltp-test-mode=STRING         test type to use {simple,complex,nontrx,sp} [complex]
  --oltp-reconnect-mode=STRING    reconnect mode {session,transaction,query,random} [session]
  --oltp-sp-name=STRING           name of store procedure to call in SP test mode []
  --oltp-read-only=[on|off]       generate only ‘read‘ queries (do not modify database) [off]
  --oltp-skip-trx=[on|off]        skip BEGIN/COMMIT statements [off]
  --oltp-range-size=N             range size for range queries [100]
  --oltp-point-selects=N          number of point selects [10]
  --oltp-simple-ranges=N          number of simple ranges [1]
  --oltp-sum-ranges=N             number of sum ranges [1]
  --oltp-order-ranges=N           number of ordered ranges [1]
  --oltp-distinct-ranges=N        number of distinct ranges [1]
  --oltp-index-updates=N          number of index update [1]
  --oltp-non-index-updates=N      number of non-index updates [1]
  --oltp-nontrx-mode=STRING       mode for non-transactional test {select, update_key, update_nokey, insert, delete} [select]
  --oltp-auto-inc=[on|off]        whether AUTO_INCREMENT (or equivalent) should be used on id column [on]
  --oltp-connect-delay=N          time in microseconds to sleep after connection to database [10000]
  --oltp-user-delay-min=N         minimum time in microseconds to sleep after each request [0]
  --oltp-user-delay-max=N         maximum time in microseconds to sleep after each request [0]
  --oltp-table-name=STRING        name of test table [sbtest]
  --oltp-table-size=N             number of records in test table [10000]
  --oltp-dist-type=STRING         random numbers distribution {uniform,gaussian,special} [special]
  --oltp-dist-iter=N              number of iterations used for numbers generation [12]
  --oltp-dist-pct=N               percentage of values to be treated as ‘special‘ (for special distribution) [1]
  --oltp-dist-res=N               percentage of ‘special‘ values to use (for special distribution) [75]

General database options:

  --db-driver=STRING  specifies database driver to use (‘help‘ to get list of available drivers)
  --db-ps-mode=STRING prepared statements usage mode {auto, disable} [auto]

Compiled-in database drivers:
  mysql - MySQL driver

mysql options:
  --mysql-host=[LIST,...]       MySQL server host [localhost]
  --mysql-port=N                MySQL server port [3306]
  --mysql-socket=STRING         MySQL socket
  --mysql-user=STRING           MySQL user [sbtest]
  --mysql-password=STRING       MySQL password []
  --mysql-db=STRING             MySQL database name [sbtest]
  --mysql-table-engine=STRING   storage engine to use for the test table {myisam,innodb,bdb,heap,ndbcluster,federated} [innodb]
  --mysql-engine-trx=STRING     whether storage engine used is transactional or not {yes,no,auto} [auto]
  --mysql-ssl=[on|off]          use SSL connections, if available in the client library [off]
  --myisam-max-rows=N           max-rows parameter for MyISAM tables [1000000]
  --mysql-create-options=STRING additional options passed to CREATE TABLE []

先sysbench测试on SSD:

my.cnf 配置如下:

[client]
port            = 3306
socket          = /ssd/mysql5.5/mysql.sock
[mysqld]
port            = 3306
socket          = /ssd/mysql5.5/mysql.sock
datadir = /ssd/mysql5.5/data
back_log = 50
character-set-filesystem=utf8
character-set-server=utf8
collation-server=utf8_general_ci
max_connections = 100
max_connect_errors = 10
table_open_cache = 2048
max_allowed_packet = 16M
binlog_cache_size = 1M
max_heap_table_size = 64M
read_buffer_size = 2M
read_rnd_buffer_size = 16M
sort_buffer_size = 8M
join_buffer_size = 8M
thread_cache_size = 8
thread_concurrency = 8
query_cache_size = 64M
query_cache_limit = 2M
ft_min_word_len = 4
default-storage-engine = INNODB
thread_stack = 192K
transaction_isolation = REPEATABLE-READ
tmp_table_size = 64M
server-id = 1
key_buffer_size = 32M
bulk_insert_buffer_size = 64M
myisam_sort_buffer_size = 128M
myisam_max_sort_file_size = 10G
myisam_repair_threads = 1
myisam_recover
innodb_additional_mem_pool_size = 16M
innodb_buffer_pool_size = 20G
innodb_file_per_table = true
innodb_data_file_path = ibdata1:10M:autoextend
innodb_data_ssd_dir = /ssd/mysql5.5/data
innodb_write_io_threads = 16
innodb_read_io_threads = 16
innodb_thread_concurrency = 16
innodb_flush_log_at_trx_commit = 1
innodb_log_buffer_size = 256M
innodb_log_file_size = 512M
innodb_log_files_in_group = 3
innodb_log_group_ssd_dir = /ssd/mysql5.5/data
innodb_max_dirty_pages_pct = 90
innodb_lock_wait_timeout = 120
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
[myisamchk]
key_buffer_size = 512M
sort_buffer_size = 512M
read_buffer = 8M
write_buffer = 8M
[mysqlhotcopy]
interactive-timeout
[mysqld_safe]
open-files-limit = 8192

接下来,使用SYSBENCH 生成初始化数据:

/usr/local/sysbench0.5/bin/sysbench --test=/usr/local/src/sysbench/sysbench/sysbench --test=/usr/local/src/sysbench/sysbench/tests/db/parallel_prepare.lua --mysql-socket=/ssd/mysql5.5/mysql.sock --mysql-user=root --mysql-table-engine=innodb --oltp-table-size=25000000 --oltp-tables-count=16 --rand-init=on --num-threads=16 --oltp-read-only=off --report-interval=10 --rand-type=special --rand-spec-pct=5 --max-requests=0 --percentile=99 --max-time=6000 run

接下来sysbench 测试OLTP应用:

/usr/local/sysbench0.5/bin/sysbench --test=/usr/local/src/sysbench/sysbench/sysbench --test=/usr/local/src/sysbench/sysbench/tests/db/oltp.lua --mysql-socket=/ssd/mysql5.5/mysql.sock --mysql-user=root --mysql-table-engine=innodb --oltp-table-size=25000000 --oltp-tables-count=16 --rand-init=on --num-threads=16 --oltp-read-only=off --report-interval=10 --rand-type=special --rand-spec-pct=5 --max-requests=0 --percentile=99 --max-time=6000 run

测试结果如下:

sysbench 0.5: multi-threaded system evaluation benchmark

Running the test with following options:
Number of threads: 16
Report intermediate results every 10 second(s)
Initializing random number generator from timer.

Random number generator seed is 0 and will be ignored

Threads started!

[ 10s] threads: 16, tps: 431.35, reads/s: 6056.98, writes/s: 1727.62, response time: 77.86ms (99%)
[ 20s] threads: 16, tps: 671.30, reads/s: 9394.20, writes/s: 2684.20, response time: 53.66ms (99%)
[ 30s] threads: 16, tps: 889.20, reads/s: 12454.40, writes/s: 3557.70, response time: 42.33ms (99%)
[ 40s] threads: 16, tps: 970.80, reads/s: 13589.70, writes/s: 3883.40, response time: 39.56ms (99%)
[ 50s] threads: 16, tps: 1024.20, reads/s: 14342.20, writes/s: 4098.50, response time: 38.07ms (99%)
[ 60s] threads: 16, tps: 1034.90, reads/s: 14480.88, writes/s: 4136.40, response time: 37.70ms (99%)
[ 70s] threads: 16, tps: 947.10, reads/s: 13266.32, writes/s: 3793.20, response time: 122.98ms (99%)
[ 80s] threads: 16, tps: 1006.20, reads/s: 14081.49, writes/s: 4020.40, response time: 77.28ms (99%)
[ 90s] threads: 16, tps: 938.30, reads/s: 13133.50, writes/s: 3753.10, response time: 129.52ms (99%)
。。。。。。。省略

OLTP test statistics:
queries performed:
read: 80147774
write: 22899364
other: 11449682
total: 114496820
transactions: 5724841 (954.14 per sec.)    (代表TPS)
deadlocks: 0 (0.00 per sec.)
read/write requests: 103047138 (17174.45 per sec.) (代表QPS)
other operations: 11449682 (1908.27 per sec.)

General statistics:
total time: 6000.0260s
total number of events: 5724841
total time taken by event execution: 95991.9466s
response time:
min: 2.11ms
avg: 16.77ms
max: 75652.05ms
approx. 99 percentile: 74.13ms

Threads fairness:
events (avg/stddev): 357802.5625/970.53
execution time (avg/stddev): 5999.4967/0.01

同样的方法测试mysql on SATA上的结果,待后续:

时间: 2024-10-18 09:09:34

Sysbench MySQL性能测试比较On SSD & SATA的相关文章

sysbench 数据库性能测试工具的使用

sysbench 数据库性能测试 Mac上安装sysbench测试工具 brew install sysbench 测试sysbench 是否安装成功 //执行这条指令 sysbench cpu --cpu-max-prime=10000 run sysbench 1.0.17 (using bundled LuaJIT 2.1.0-beta2) Running the test with following options: Number of threads: 1 Initializing

选盘秘籍:用户如何选择SSD/SATA/SAS?

先学习下一些专业词汇 IDE (Integrated Drive Electronics) 电子集成驱动器 它的本意是指把"硬盘控制器"与"盘体"集成在一起的硬盘驱动器.把盘体与控制器集成在一起的做法减少了硬盘接口的电缆数目与长度,数据传输的可靠性得到了增强,硬盘制造起来变得更容易,因为硬盘生产厂商不需要再担心自己的硬盘是否与其它厂商生产的控制器兼容.对用户而言,硬盘安装起来也更为方便.IDE这一接口技术从诞生至今就一直在不断发展,性能也不断的提高,其拥有的价格低廉

MySQL性能测试调优

MySQL性能测试调优 操作系统 基本操作 查看磁盘分区mount选项 $ mount 永久修改分区mount选项(系统重启后生效) 修改文件 /etc/fstab 中对应分区的mount options列的值 在线修改分区mount选项(系统重启后失效) $sudo -t ext4 -o remount,noatime,errors=remount-or / 文件系统优化 ext4文件系统优化 分区mount选项加noatime $sudo -t ext4 -o remount,noatime

Mysql 性能测试工具 sysbench的安装和使用

工作上需要用到AWS和Azure的Mysql服务,需要测试比较一下两个云服务的性能.于是开始百度 + google,查找性能测试工具.最终决定用sysbench. sysbench介绍 sysbench是一款开源的多线程性能测试工具,可以执行CPU/内存/线程/IO/数据库等方面的性能测试. 数据库目前支持MySQL/Oracle/PostgreSQL.本文只是简单演示一下几种测试的用法,后续准备利用sysbench来对MySQL进行一系列的测试.具体的一些参数设置,需要根据不同的测试要求来进行

MySQL性能测试工具sysbench的安装和使用

sysbench是一个开源的.模块化的.跨平台的多线程性能测试工具,可以用来进行CPU.内存.磁盘I/O.线程.数据库的性能测试.目前支持的数据库有MySQL.Oracle和PostgreSQL.当前功能允许测试的系统参数有: file I/O performance (文件I / O性能) scheduler performance (调度性能) memory allocation and transfer speed (内存分配和传输速度) POSIX threads implementat

mysql性能测试工具之sysbench

sysbench是一个模块化的.跨平台.多线程基准测试工具,主要用于评估测试各种不同系统参数 下的数据库负载情况,主要测试以下几种: (1).cpu性能 (2).磁盘io性能 (3).调度程序性能 (4).内存分配及传输速度 (5).POSIX线程性能 (6).数据库性能(OLTP基准测试) 1.下载和安装sysbench工具 [[email protected] home]# wget http://down1.chinaunix.net/distfiles/sysbench-0.4.10.t

mysql性能测试工具之tpcc-mysql

1.安装配置 官网下载地址:http://imysql.com/wp-content/uploads/2014/09/tpcc-mysql-src.tgz1. 用bzr客户端下载软件包[[email protected] ~]# yum install bzr -y [[email protected] ~]# bzr branch lp:~percona-dev/perconatools/tpcc-mysql[[email protected] ~]# cd tpcc-mysql/src/[[

MySQL性能测试(一)&mdash;&mdash;RHEL 7.1, MySQL 5.6.25, sql-bench

由于前段时间要测试全闪存阵列上运行MySQL的性能,因此研究了段时间,试验了两个工具:一个是MySQL自带的sql-bench,一个是sysbench. 本过程使用的环境是Redhat Enterprise Linux 7.1, MySQL 5.6.25,测试工具则是mysql自带的sql-bench工具.由于使用MySQL RPM包中不包含sql-bench目录,因此我选用了使用MySQL源代码安装. 由于MySQL 5.6之后是使用cmake编译,因此也需要安装cmake. 1. 安装Red

关于网络上的各种mysql性能测试结论

关于网上的各种性能测试帖子,我想说以下几点: 1.为了使性能测试更加的客观.实际,应该说明针对什么场景进行测试,查询.还是修改,是否包含了主键,包含了几个索引,各自的差别是什么.因为不同的mysql分支,之所以存在是因为有其解决的点存在,而不是为了山寨而山寨:更有甚者,甚至直接拿pg进行测试得出结论: 2.测试所用硬件应该具有实际代表性,很多的测试用vm,1g,2g的内存,n旧的cpu或者笔记本的cpu进行测试,这种测试根本就没有典型意义:实际的生产机器再不济用公有云,那也得intel e系列c