关于linux下super-smack对Mysql 5.0 的性能测试

最近做linux下mysql5.0的性能测试,用了一下super-smack工具
网上的资料很多,关于select-sky.smack文件的正确修改方案也有很多,但就是没找到关于update-select.smack文件的,而只是有提到用命令
super-smack -d mysql update-select.smack 10 1000

update-select.smack文件跟select-sky.smack很相似,只是多了

query "update_by_username"
{ }

在这里我把正确的select-sky.smack文件附上
[quote]
// this is will be used in the table section
client "admin"
{
user "root";//mysql 用户名
host "localhost";
db "test";//database name
pass "";//password
socket "/var/lib/mysql/mysql.sock"; // this only applies to MySQL and is
// ignored for PostgreSQL
}

// ensure the table exists and meets the conditions
table "http_auth"
{
client "admin"; // connect with this client
// if the table is not found or does not pass the checks, create it
// with the following, dropping the old one if needed
create "create table http_auth
(username char(25) not null primary key,
pass char(25),
uid integer not null,
gid integer not null
)";
min_rows "90000"; // the table must have at least that many rows
data_file "http_auth.dat"; // if the table is empty, load the data from
//this file
gen_data_file "gen-data -n 90000 -f %12-12s%n,%25-25s,%n,%d";
// if the file above does not exist, generate it with the above command
}


//define a dictionary
dictionary "word"
{
type "rand";
source_type "file";
source "words.dat";
delim " "; // 将","号改为"tab"
file_size_equiv "45000"; }

//define a query
query "select_by_username"
{
query "select * from http_auth where username = '$word'";
type "select_index";
has_result_set "y";
parsed "y";

}

query "update_by_username"
{
query "update http_auth set pass='$word' where username = '$word'";
type "update_index";
has_result_set "y";
parsed "y";
}


// define database client type

client "smacker2"
{
user "root"; //这里的设置同上
pass "";
host "localhost";
db "test";
socket "/var/lib/mysql/mysql.sock";
query_barrel "1 select_by_username 1 update_by_username";
// 运行一次select_by_username 和 query update_by_username
//运行次数可根据需要修改
}

main
{

smacker2.init(); //smacker2必须和你上面定义的client type用户名相同
//smacker2.set_num_rounds($2); //原文件多了一行,可能会使你的脚本无法运行,在这里删掉
smacker2.set_num_rounds($2);
smacker2.create_threads($1);
smacker2.connect();
smacker2.unload_query_barrel();
smacker2.disconnect();

}[/quote]
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值