您的位置:首页 > 数据库

sysbench与sqlyog的安装和使用

2017-04-12 18:40 495 查看

sysbench与sqlyog的安装和使用

sysbench

sysbench是一款开源的多线程性能测试工具,可以执行CPU/内存/线程/IO/数据库等方面的性能测试。

默认支持MySQL,如果需要测试Oracle/PostgreSQL,则在configure时需要加上–with-oracle或者–with-pgsql参数

安装
RHEL/CentOS


yum -y install sysbench

Fedora

dnf -y install sysbench



Debian/Ubunu


apt -y install sysbench


我的环境是centOS6.5
Installed:
  sysbench.i686 0:0.4.12-5.el6                                                  

Complete!
[root@wuwu1 ~]# 


在工具创建一个测试表

[root@wuwu1 src]# sysbench --test=oltp --mysql-host=localhost --mysql-table-engine=innodb --oltp-table-size=1000000 --mysql-user=root --mysql-password=12345 --db-driver=mysql --mysql-db=test prepare
sysbench 0.4.12:  multi-threaded system evaluation benchmark

Creating table 'sbtest'...
Creating 1000000 records in table 'sbtest'...

执行测试

[root@wuwu1 src]# sysbench --test=oltp --mysql-host=localhost --mysql-table-engine=innodb --oltp-table-size=1000000 --mysql-user=root --mysql-password=12345 --db-driver=mysql --mysql-db=test run
sysbench 0.4.12:  multi-threaded system evaluation benchmark

Running the test with following options:
Number of threads: 1

Doing OLTP test.
Running mixed OLTP test
Using Special distribution (12 iterations,  1 pct of values are returned in 75 pct cases)
Using "BEGIN" for starting transactions
Using auto_inc on the id column
Maximum number of requests for OLTP test is limited to 10000
Threads started!
Done.

OLTP test statistics:
    queries performed:
        read:                            140000
        write:                           50000
        other:                           20000
        total:                           210000
    transactions:                        10000  (128.45 per sec.)
    deadlocks:                           0      (0.00 per sec.)
    read/write requests:                 190000 (2440.53 per sec.)
    other operations:                    20000  (256.90 per sec.)

Test execution summary:
    total time:                          77.8519s
    total number of events:              10000
    total time taken by event execution: 77.7487
    per-request statistics:
         min:                                  3.18ms
         avg:                                  7.77ms
         max:                                393.10ms
         approx.  95 percentile:              19.89ms

Threads fairness:
    events (avg/stddev):           10000.0000/0.00
    execution time (avg/stddev):   77.7487/0.00

SQLyog

SQLyog是一个易于使用的、快速而简洁的图形化管理MYSQL数据库的工具,它能够在任何地点有效地管理你的数据库!

官方网站: http://www.webyog.com
项目地址: https://github.com/webyog/sqlyog-community

下载地址: https://github.com/webyog/sqlyog-community/wiki/Downloads





内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: