设为首页 收藏本站
查看: 1388|回复: 0

[经验分享] 对MYSQL进行压力测试

[复制链接]

尚未签到

发表于 2018-9-27 08:06:33 | 显示全部楼层 |阅读模式
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
  我遇到的问题如下:
  error while loading shared libraries: libmysqlclient.so.16: cannot open shared object file: No such file or directory
  看到北京野狼的这个帖子:
  http://bbs.chinaunix.net/archiver/?tid-638662.html
  [root@localhost super-smack-1.2]# ./configure --with-mysql
  configure: error: installation or configuration problem: C++ compiler cannot create executables.
  没有安装C++编译器
  [root@localhost rpmpackage]# rpm -ivh libc-client-2004g-2.2.1.i386.rpm
  Preparing...                ########################################### [100%]
  1:libc-client            ########################################### [100%]
  [root@localhost rpmpackage]# rpm -ivh libc-client-devel-2004g-2.2.1.i386.rpm
  Preparing...                ########################################### [100%]
  1:libc-client-devel      ########################################### [100%]
  [root@localhost rpmpackage]# rpm -ivh libstdc++-devel-4.1.1-52.el5.i386.rpm
  Preparing...                ########################################### [100%]
  1:libstdc++-devel        ########################################### [100%]
  [root@localhost rpmpackage]# rpm -ivh gcc-c++-4.1.1-52.el5.i386.rpm
  Preparing...                ########################################### [100%]
  1:gcc-c++                ########################################### [100%]
  [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
  其他问题看
  http://vegan.net/tony/supersmack/FAQ.php
  2、进行实际测试。
  拷贝示例文件。
  [root@localhost super-smack-1.3]# cp -r smacks/ /usr/local/bin/
  修改用户名和密码为自己的
  默认是测试MYISAM表的性能。
  [root@localhost smacks]# super-smack -d mysql select-key.smack 10 1000
  Error running query select count(*) from http_auth:Table 'test.http_auth' doesn't exist
  Creating table 'http_auth'
  Loading data from file '/var/smack-data/words.dat' into table 'http_auth'
  Table http_auth is now ready for the test
  Query Barrel Report for client smacker1
  connect: max=156ms  min=0ms avg= 21ms from 10 clients
  Query_type      num_queries     max_time        min_time        q_per_s
  select_index    20000   0       0       16299.96
  10 是连接客户的数目,每个客户有100次轮询。
  结果表示:super-smack总共执行了2W次查询,每秒执行16299.96 条数据
  下来测试innodb 表
  进入MYSQL的SHELL,修改表类型

  mysql>>  Query OK, 90000 rows affected (15.18 sec)
  Records: 90000  Duplicates: 0  Warnings: 0
  [root@localhost smacks]# super-smack -d mysql select-key.smack 10 1000
  Query Barrel Report for client smacker1
  connect: max=117ms  min=0ms avg= 18ms from 10 clients
  Query_type      num_queries     max_time        min_time        q_per_s
  select_index    20000   0       0       16747.00
  [root@localhost smacks]#
  接下来测试集群的

  mysql>>  Query OK, 90000 rows affected (11.14 sec)
  Records: 90000  Duplicates: 0  Warnings: 0
  [root@localhost smacks]# super-smack -d mysql select-key.smack 10 1000
  Query Barrel Report for client smacker1
  connect: max=3ms  min=0ms avg= 0ms from 10 clients
  Query_type      num_queries     max_time        min_time        q_per_s
  select_index    20000   3       1       2587.91
  看一下update的。
  [root@localhost smacks]# super-smack -d mysql update-select.smack 100 10000
  Table 'http_auth' does not meet condtions, will be dropped
  Creating table 'http_auth'
  Loading data from file '/var/smack-data/words.dat' into table 'http_auth'
  Table http_auth is now ready for the test
  Query Barrel Report for client smacker
  connect: max=752ms  min=0ms avg= 108ms from 100 clients
  Query_type      num_queries     max_time        min_time        q_per_s
  select_index    1000000 19      0       3837.48
  update_index    1000000 20      0       3837.48
  这个测试结果怎么表名MYISAM表的SELECT比INNODB的还差。
  具体原因我会找找看。


运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-602545-1-1.html 上篇帖子: 【MySQL】【ProxySQL】ProxySQL Cluster的搭建 下篇帖子: 【超简单】MySQL存储引擎的选择与配置
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表