熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> MySQL >> 正文

淺析對MYSQL進行壓力測試的過程

2022-06-13   來源: MySQL 

安裝supersmack

  安裝過程以及我中間遇到問題的總結都在這裡

  之前記得把libmysqlclientso拷貝到/usr/lib中去這樣make 的時候不用改MakeFile文件

  [root@localhost supersmack]# cp /usr/local/mysql/libmysqlclientso /usr/lib

  我遇到的問題如下

  error while loading shared libraries: libmysqlclientso: cannot open shared object file: No such file or directory

  看到北京野狼的這個帖子

  [root@localhost supersmack]# /configure withmysql

  configure: error: installation or configuration problem: C++ compiler cannot create executables

  沒有安裝C++編譯器

  [root@localhost rpmpackage]# rpm ivh libcclientgirpm

  Preparing… ########################################### [%]

  :libcclient ########################################### [%]

  [root@localhost rpmpackage]# rpm ivh libcclientdevelgirpm

  Preparing… ########################################### [%]

  :libcclientdevel ########################################### [%]

  [root@localhost rpmpackage]# rpm ivh libstdc++develelirpm

  Preparing… ########################################### [%]

  :libstdc++devel ########################################### [%]

  [root@localhost rpmpackage]# rpm ivh gccc++elirpm

  Preparing… ########################################### [%]

  :gccc++ ########################################### [%]

  [root@localhost rpmpackage]# cd /sourcepackage/supersmack

  [root@localhost supersmack]# /configure withmysql

  loading cache /configcache

  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 /configcache

  creating /configstatus

  creating Makefile

  creating src/Makefile

  creating configh

  Building with the following options:

  MySQL Support…… yes

  PostgreSQL Support…… no

  Oracle Support…… no

  If this is not what you intended please rerun configure

  Thanks for using supersmack!

  然後make;make install

  進行實際測試

  拷貝示例文件

  [root@localhost supersmack]# cp r smacks/ /usr/local/bin/

  修改用戶名和密碼為自己的

  默認是測試MYISAM表的性能

  [root@localhost smacks]# supersmack d mysql selectkeysmack

  Error running query select count(*) from http_auth:Table testhttp_auth doesnt exist

  Creating table http_auth

  Loading data from file /var/smackdata/wordsdat into table http_auth

  Table http_auth is now ready for the test

  Query Barrel Report for client smacker

  connect: max=ms min=ms avg= ms from clients

  Query_type num_queries max_time min_time q_per_s

  select_index

   是連接客戶的數目每個客戶有次輪詢

  結果表示supersmack總共執行了W次查詢每秒執行 條數據

  下來測試innodb 表

  進入MYSQL的SHELL修改表類型

  mysql> alter table http_auth engine innodb;

  Query OK rows affected ( sec)

  Records: Duplicates: Warnings:

  [root@localhost smacks]# supersmack d mysql selectkeysmack

  Query Barrel Report for client smacker

  connect: max=ms min=ms avg= ms from clients

  Query_type num_queries max_time min_time q_per_s

  select_index

  [root@localhost smacks]#

  接下來測試集群的

  mysql> alter table http_auth engine ndb;

  Query OK rows affected ( sec)

  Records: Duplicates: Warnings:

  [root@localhost smacks]# supersmack d mysql selectkeysmack

  Query Barrel Report for client smacker

  connect: max=ms min=ms avg= ms from clients

  Query_type num_queries max_time min_time q_per_s

  select_index

  看一下update的

  [root@localhost smacks]# supersmack d mysql updateselectsmack

  Table http_auth does not meet condtions will be dropped

  Creating table http_auth

  Loading data from file /var/smackdata/wordsdat into table http_auth

  Table http_auth is now ready for the test

  Query Barrel Report for client smacker

  connect: max=ms min=ms avg= ms from clients

  Query_type num_queries max_time min_time q_per_s

  select_index

  update_index

  這個測試結果怎麼表名MYISAM表的SELECT比INNODB的還差


From:http://tw.wingwit.com/Article/program/MySQL/201405/30870.html
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.