首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >mysql OLTP测试中的Sysbench错误

mysql OLTP测试中的Sysbench错误
EN

Server Fault用户
提问于 2011-10-20 13:11:54
回答 1查看 2.8K关注 0票数 2

我使用以下设置在运行MySQL 5.5.16的RHEL5.6服务器上运行sysbench:

代码语言:javascript
复制
sysbench --test=oltp --db-driver=mysql --mysql-user=sbench \
 --mysql-socket=/var/lib/mysql/mysql.sock --mysql-db=sbench \
 --mysql-table-engine=innodb --oltp-table-size=1000000 prepare

这将创建默认的工作台表,如下所示:

代码语言:javascript
复制
mysql> SHOW CREATE TABLE sbench.sbtest\G
*************************** 1. row ***************************
       Table: sbtest
Create Table: CREATE TABLE `sbtest` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `k` int(10) unsigned NOT NULL DEFAULT '0',
  `c` char(120) NOT NULL DEFAULT '',
  `pad` char(60) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`),
  KEY `k` (`k`)
) ENGINE=InnoDB AUTO_INCREMENT=1000001 DEFAULT CHARSET=latin1
1 row in set (0.04 sec)

对1,000,000行运行16个线程innodb读/写测试:

代码语言:javascript
复制
sysbench --num-threads=16 --test=oltp --db-driver=mysql --mysql-user=sbench \
  --mysql-socket=/var/lib/mysql/mysql.sock --mysql-db=sbench \
  --mysql-table-engine=innodb --oltp-table-size=100000 \
  --oltp-reconnect-mode=query --batch --batch-delay=5 run

结果出现以下错误

代码语言:javascript
复制
[1319136662] sysbench 0.4.12:  multi-threaded system evaluation benchmark

[1319136663] Running the test with following options:
[1319136663] Number of threads: 16
[1319136663] 
[1319136663] Doing OLTP test.
[1319136663] Running mixed OLTP test
[1319136663] Using Special distribution (12 iterations,  1 pct of values are returned in 75 pct cases)
[1319136663] Using "BEGIN" for starting transactions
[1319136663] Using auto_inc on the id column
[1319136663] Maximum number of requests for OLTP test is limited to 10000
[1319136663] Threads started!
[1319136668] min: 0.2181  avg: 0.2484  max: 0.3025  percentile: 0.2715
[1319136673] min: 0.2181  avg: 0.2454  max: 0.3025  percentile: 0.2646
[1319136678] min: 0.2173  avg: 0.2441  max: 0.3115  percentile: 0.2646
[1319136683] min: 0.2173  avg: 0.2435  max: 0.3115  percentile: 0.2648
[1319136688] min: 0.2173  avg: 0.2440  max: 0.3115  percentile: 0.2663
ALERT: [1319136690] failed to execute mysql_stmt_execute(): Err1062 Duplicate entry '49616' for key 'PRIMARY'
FATAL: [1319136690] database error, exiting...
[1319136691] Done.

我对使用sysbench相当陌生,但这是一个错误吗,还是我配置错了什么东西使它插入重复的主键?

EN

回答 1

Server Fault用户

回答已采纳

发布于 2011-10-20 20:16:31

不介意,我想我找到了。

我将测试设置为-oltp-table-size=1000000 (1m),然后使用-oltp-table-size=100000(100 K)运行测试。

使用正确的数字(1m)运行它,16个线程成功完成。

票数 1
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/323264

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档