对MYSQL进行压力测试

1、安装supersmack
http://vegan.net/tony/supersmack/
安装过程以及我中间遇到问题的总结都在这里。
之前记得把libmysqlclient.so.16拷贝到/usr/lib中去,这样make 的时候不用改MakeFile文件。
[root@localhost super-smack-1.3]# cp /usr/local/mysql/libmysqlclient.so.16 /usr/lib
[root@localhost rpmpackage]# cd ../sourcepackage/super-smack-1.2
[root@localhost super-smack-1.2]# ./configure --with-mysql
loading cache ./config.cache
checking for a BSD compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking whether make sets ${MAKE}... yes
...
updating cache ./config.cache
creating ./config.status
creating Makefile
creating src/Makefile
creating config.h


Building with the following options:

MySQL Support..................... yes
PostgreSQL Support................ no
Oracle Support.................... no

If this is not what you intended, please re-run configure.

Thanks for using super-smack!
然后make;make install

2、进行实际测试。
拷贝示例文件。
[root@localhost super-smack-1.3]# cp -r smacks/ /usr/local/bin/
修改用户名和密码为自己的
[root@localhost smacks]# super-smack -d mysql select-key.smack 10 10000
10 是连接客户的数目,每个客户有10000次轮询。

默认是测试MYISAM表的性能。
mysql> alter table http_auth engine myisam;

Query Barrel Report for client smacker1
connect: max=358ms  min=0ms avg= 93ms from 10 clients
Query_type      num_queries     max_time        min_time        q_per_s
select_index    200000  0       0       36678.87

Query Barrel Report for client smacker1
connect: max=2ms  min=0ms avg= 0ms from 10 clients
Query_type      num_queries     max_time        min_time        q_per_s
select_index    200000  0       0       36312.06

下来测试innodb表,修改表类型
mysql> alter table http_auth engine innodb;

Query Barrel Report for client smacker1
connect: max=50ms  min=0ms avg= 16ms from 10 clients
Query_type      num_queries     max_time        min_time        q_per_s
select_index    200000  0       0       39852.46

Query Barrel Report for client smacker1
connect: max=8ms  min=0ms avg= 3ms from 10 clients
Query_type      num_queries     max_time        min_time        q_per_s
select_index    200000  0       0       38331.63


接下来内存类型
mysql> alter table http_auth engine memory;

Query Barrel Report for client smacker1
connect: max=243ms  min=0ms avg= 26ms from 10 clients
Query_type      num_queries     max_time        min_time        q_per_s
select_index    200000  0       0       45608.34

Query Barrel Report for client smacker1
connect: max=139ms  min=0ms avg= 55ms from 10 clients
Query_type      num_queries     max_time        min_time        q_per_s
select_index    200000  0       0       43428.97

接下来测试集群的
mysql> alter table http_auth engine ndb;

Query Barrel Report for client smacker1
connect: max=0ms  min=0ms avg= 0ms from 10 clients
Query_type      num_queries     max_time        min_time        q_per_s
select_index    200000  0       0       19831.67

Query Barrel Report for client smacker1
connect: max=2ms  min=0ms avg= 0ms from 10 clients
Query_type      num_queries     max_time        min_time        q_per_s
select_index    200000  0       0       20116.44

这个测试结果怎么表名MYISAM表的SELECT比INNODB的还差,MEMORY最快,毕竟是用内存。

看一下update的。
[root@localhost smacks]# super-smack -d mysql update-select.smack 10 10000

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值