Chinaunix首页 | 论坛 | 博客
  • 博客访问: 246927
  • 博文数量: 61
  • 博客积分: 2510
  • 博客等级: 少校
  • 技术积分: 800
  • 用 户 组: 普通用户
  • 注册时间: 2008-02-14 15:18
文章分类

全部博文(61)

文章存档

2011年(4)

2010年(5)

2009年(10)

2008年(42)

我的朋友

分类: Mysql/postgreSQL

2008-07-30 16:54:24

1. 源:
 
2. 安装:
   注意在编译时,可以先把对应的libmysqlclient.so.*拷贝到/usr/lib
 
3. 测试:
[root@DB_Backup smacks]# super-smack -d mysql select-key.smack 10 10000
Query Barrel Report for client smacker1
connect: max=37ms  min=0ms avg= 10ms from 10 clients
Query_type      num_queries     max_time        min_time        q_per_s
select_index    200000  0       0       10148.47
 
[root@DB_Backup smacks]# super-smack -d mysql update-select.smack 10 1000
Query Barrel Report for client smacker
connect: max=2ms  min=0ms avg= 0ms from 10 clients
Query_type      num_queries     max_time        min_time        q_per_s
select_index    10000   1       0       4038.90
update_index    10000   1       0       4038.90
 
在以上测试结果中,
    * 10代表10个客户端同时接入,1000代表每个客户端的查询次数(脚本中,对查询次数做了翻倍处理)
    * max、min、avg为客户端最大、最小、平均连接时间
    * num_queries、max_time、min_time为总请求次数,最大、最小查询时间(以毫秒为单位)
    * q_per_s为每秒处理的请求数
 
4. 错误处理
 4.1. For 64 bits system, will meet the error message:
# make
make  all-recursive
make[1]: Entering directory `/usr/local/src/super-smack-1.3'
Making all in src
make[2]: Entering directory `/usr/local/src/super-smack-1.3/src'
g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/local/mysql/include      -g -O2 -c query.cc
query.cc: In member function ‘void Query_report::fd_send(int)’:
query.cc:200: error: cast from ‘char*’ to ‘unsigned int’ loses precision
query.cc:200: error: cast from ‘char*’ to ‘unsigned int’ loses precision
query.cc:219: error: cast from ‘char*’ to ‘unsigned int’ loses precision
query.cc:219: error: cast from ‘char*’ to ‘unsigned int’ loses precision
make[2]: *** [query.o] Error 1
make[2]: Leaving directory `/usr/local/src/super-smack-1.3/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/src/super-smack-1.3'
make: *** [all-recursive-am] Error 2
 
modify the source file query.cc:
unsigned --> long
 
 4.2 can't load lib file
# super-smack select-key.smack 10 10
super-smack: error while loading shared libraries: libmysqlclient.so.16: cannot open shared object file: No such file or directory
 
Solution:
echo "/usr/local/mysql/lib/" >> /etc/ld.so.conf
ldconfig -v
阅读(1733) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~