日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

使用数据库的压测工具super-smack测试mysql数据库性能

發布時間:2023/11/29 数据库 24 豆豆
生活随笔 收集整理的這篇文章主要介紹了 使用数据库的压测工具super-smack测试mysql数据库性能 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
一、下載 super-smack 下載地址:http://vegan.net/tony/supersmack/ 源碼:http://vegan.net/tony/supersmack/super-smack-1.3.tar.gz 二、編譯及安裝 配置編譯選項:./configure --prefix=/usr/local/super-smack-1.3 --with-mysql --with-smacks-dir=/usr/local/super-smack-1.3 請根據測試的數據庫來選擇 --with-pgsql --with-oracle 或 --with-mysql 重點說明一下--with-mysql的編譯配置: 編譯的時候要把/usr/lib64目錄下的libmysqlclient.so.16放到/usr/lib目錄下,否則會出現下面的錯誤: configure: error: Could not find libmysqlclient in ' /usr/lib /usr/lib/mysql ? ? ? ? ? ? ? ? ? ?/usr/local/lib /usr/local/lib/mysql ? ? ? ? ? ? ? ? ? ?/usr/local/mysql/lib configure: error: Could not find mysql.h in ' /usr/include /usr/include/mysql ? ? ? ? ? ? ? ? ? ? ? ?/usr/local/include /usr/local/include/mysql ? ? ? ? ? ? ? ? ? ? ? ?/usr/local/mysql/include' 由于我的mysql是自行編譯的,所以我這樣操作 cd /usr/include; ln -s /usr/local/mysql/include/mysql cd /usr/lib; ln -s /usr/local/mysql/lib/mysql 編譯及安裝: make;make install 三、使用方法及常見問題 為方便使用 ln -s /usr/local/super-smack/bin/super-smack /usr/local/bin/ ln -s /usr/local/super-smack/bin/gen-data /usr/local/bin/ 使用方法: cd /usr/lib;ln -s /usr/local/mysql/lib/mysql/libmysqlclient.so.16.0.0 libmysqlclient.so.16 或者 cd /usr/lib;cp -a /usr/local/mysql/lib/mysql/libmysqlclient.so.16.0.0 libmysqlclient.so.16 否則會有如下問題: # super-smack -d mysql /usr/local/super-smack/select-key.smack 10 1000 super-smack: error while loading shared libraries: libmysqlclient.so.16: cannot open shared object file: No such file or directory 注意可能要根據實際情況修改select-key.smack文件中數據庫連接部分的配置。 注意還需要指定select-key.smack 文件的具體位置,否則會出現下面的錯誤提示。 # super-smack select-key.smack 10 1000 super-smack: Could not open input file select-key.smack errno = 2, error is No such file or directory 四、正常使用的范例 [root@MySQL lib]# super-smack -d mysql /usr/local/super-smack/select-key.smack 10 1000 ? ? ?? Error running query select count(*) from http_auth:Table 'test.http_auth' doesn't exist Creating table 'http_auth' Populating data file '/var/smack-data/words.dat' with shell command 'gen-data -n 90000 -f %12-12s%n,%25-25s,%n,%d' 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=2809ms ?min=3ms avg= 586ms from 10 clients? Query_type ? ? ?num_queries ? ? max_time ? ? ? ?min_time ? ? ? ?q_per_s select_index ? ?20000 ? 0 ? ? ? 0 ? ? ? 2243.93 注意,本文只是拋磚引玉,實際測試中,根據實際情況,需要認真構造測試腳本。

轉載于:https://blog.51cto.com/wangxiaoyu/463311

總結

以上是生活随笔為你收集整理的使用数据库的压测工具super-smack测试mysql数据库性能的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。