您的位置:首页 > 其它

Sysbench with support of multi-tables workload

2014-07-08 18:34 218 查看
本文转载自:http://www.mysqlperformanceblog.com/2011/04/29/sysbench-with-support-of-multi-tables-workload/

We just pushed to sysbench support for workload against multiple tables ( traditionally it used only single table).

It is available from launchpad source tree
lp:sysbench
.

This is set of LUA scripts for sysbench 0.5 ( it supports scripting), and it works following way:

- you should use
--test=tests/db/oltp.lua
to run OLTP test

i.e. prepare

Shell

1./sysbench --test=tests/db/oltp.lua --oltp-tables-count=25 prepare
run:Shell

1

./sysbench--test=tests/db/oltp.lua--oltp-tables-count=25--num-threads=5run

oltp.lua
should understand most options that available for regular sysbench –test=oltp

there are couple other scripts, like

oltp_simple

select

insert

delete

update_index

update_non_index


to support different OLTP modes.

Most interesting: all scripts support
--oltp-tables-count=N
( default 1), in this case N sbtest tables will be used.

Additional parameter
--oltp-secondary
is taken from Mark Callaghan’s sysbench tree , in this case

table sbtest will be created with
KEY xid (ID)
, instead of
PRIMARY KEY (ID)


Now, as we have N tables, we may want to prepare them in parallel, to save some time for preparation

I implemented that in script
parallel_prepare.lua


so instead of

Shell

1./sysbench --test=tests/db/oltp.lua --oltp-tables-count=25 prepare
you may useShell

1

./sysbench--test=tests/db/parallel_prepare.lua--oltp-tables-count=64--num-threads=8run

( please note that oltp-tables-count should be multiplier of num-threads)

注:近期参加MySQL运维学习,老师推荐该文章作为学习和技术提高的扩展阅读,先记录到自己的博客中,随后慢慢消化、学习、提高。本文与MySQL数据库 “压力测试”主题有关。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐