Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1298609
  • 博文数量: 127
  • 博客积分: 2286
  • 博客等级: 大尉
  • 技术积分: 1943
  • 用 户 组: 普通用户
  • 注册时间: 2010-06-10 10:37
文章分类

全部博文(127)

文章存档

2018年(1)

2015年(2)

2014年(1)

2013年(30)

2012年(88)

2011年(5)

分类: Mysql/postgreSQL

2012-01-18 15:43:41

How to use flexAsynch for performance testing with MySQL Cluster

flexAsynch is not included in the binary package of MySQL Cluster, we need to install it from the source code.


1. Install MySQL cluster from the source package:
====================================================================
wget http://dev.mysql.com/get/Downloads/MySQL-Cluster-7.1/mysql-cluster-gpl-7.1.18.tar.gz/from/http://mysql.linux.cz/


--------------------------------------------------------------------
To build under Unix/Linux, you must have the following tools installed:

* A good make program. Although some platforms come with their
own make implementations, it is highly recommended that you
use GNU make 3.75 or newer. It may already be available on
your system as gmake. GNU make is available from


* autoconf 2.58 (or newer), available from


* automake 1.8.1, available from


* libtool 1.5, available from
1.5.24 or later is
recommended.

* m4, available from

* bison, available from You
should use the latest version of bison where possible.
Versions 1.75 and 2.1 are known to work. There have been
reported problems with bison 1.875. If you experience
problems, upgrade to a later, rather than earlier, version.
* ncurses-devel, gcc, gcc-c++,
--------------------------------------------------------------------

find . |grep -i flexAsynch
./storage/ndb/test/ndbapi/flexAsynch.cpp



export CFLAGS="-O3 -DHAVE_DLOPEN=1"
export CXX=gcc
export CXXFLAGS="-O3 -DHAVE_DLOPEN=1 -felide-constructors -fno-exceptions -fno-rtti"

./configure \
--prefix=/mysql/mysqlc718 \
--localstatedir=/sqldata/mysql-cluster/ndb_data \
--with-tcp-port=3306 \
--with-unix-socket-path=/sqldata/conf/mysql_sn1.sock \
--with-mysqld-user=mysql \
--with-ndb-test \
--enable-assembler --with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static \
--with-big-tables \
--with-plugin-myisam \
--with-plugin-partition \
--with-plugin-ndbcluster \
--with-plugin-innodb_plugin \
--without-plugin-archive \
--without-plugin-blackhole \
--without-plugin-example \
--without-plugin-federated \
--without-docs --without-man \
--enable-thread-safe-client

make
make install

ls -l /mysql/mysqlc718/bin/flexAsynch
-rwxr-xr-x 1 mysql mysql 66934 Jan 18 11:40 /mysql/mysqlc718/bin/flexAsynch

2. How to use it
====================================================================
/mysql/mysqlc718/bin/flexAsynch -h
FLEXASYNCH
Perform benchmark of insert, update and delete transactions

Arguments:
-t Number of threads to start, default 1
-p Number of parallel transactions per thread, default 32
-o Number of transactions per loop, default 500
-l Number of loops to run, default 1, 0=infinite
-load_factor Number Load factor in index in percent (40 -> 99)
-a Number of attributes, default 25
-c Number of operations per transaction
-s Size of each attribute, default 1
(PK is always of size 1, independent of this value)
-simple Use simple read to read from database
-dirty Use dirty read to read from database
-write Use writeTuple in insert and update
-n Use standard table names
-no_table_create Don't create tables in db
-temp Create table(s) without logging
-no_hint Don't give hint on where to execute transaction coordinator
-adaptive Use adaptive send algorithm (default)
-force Force send when communicating
-non_adaptive Send at a 10 millisecond interval
-local Number of part, only use keys in one part out of 16
-ndbrecord Use NDB Record
-r Number of extra loops
-insert Only run inserts on standard table
-read Only run reads on standard table
-update Only run updates on standard table
-delete Only run deletes on standard table
-create_table Only run Create Table of standard table
-drop_table Only run Drop Table on standard table
-warmup_time Warmup Time before measurement starts
-execution_time Execution Time where measurement is done
-cooldown_time Cooldown time after measurement completed
-table Number of standard table, default 0

Important parameters:
-----------------------------------------------
-l test iterations
-t threads
-p parallel
-o transactions per loop
-c operations per transaction
total operations = T*p*o*c


3. example
====================================================================

The most good test result is:
/mysql/mysqlc718/bin/flexAsynch -t 1 -p 80 -l 2 -o 100 -c 100 -n
--------------------------------------------------
Dropping table TAB0...
insert average: 84025/s min: 83116/s max: 84934/s stddev: 1%
update average: 88570/s min: 88173/s max: 88967/s stddev: 0%
delete average: 101015/s min: 99415/s max: 102616/s stddev: 1%
read average: 93951/s min: 86777/s max: 98425/s stddev: 5%


/mysql/mysqlc718/bin/flexAsynch -h
/mysql/mysqlc718/bin/flexAsynch -n -create_table
/mysql/mysqlc718/bin/flexAsynch -t 100 -p 1 -l 2 -o 100 -c 100 -n -insert
/mysql/mysqlc718/bin/flexAsynch -n -drop_table


4. others
====================================================================
/mysql/mysqlc718/bin/flexAsynch -t 100 -p 1 -l 2 -o 100 -c 100 -n
Executing inserts
--------------------------------------------------
NDBT: ErrorCode = 1221 occurred 646 times
Total number of transactions is 10000
Execution time is 13834 milliseconds
Total transactions per second 722


/mysql/mysqlc718/bin/flexAsynch -t 10 -p 10 -l 2 -o 100 -c 100 -n
/mysql/mysqlc718/bin/flexAsynch -t 1 -p 10 -l 2 -o 100 -c 100 -n
/mysql/mysqlc718/bin/flexAsynch -t 1 -p 50 -l 2 -o 100 -c 100 -n
/mysql/mysqlc718/bin/flexAsynch -t 1 -p 80 -l 2 -o 100 -c 100 -n
--------------------------------------------------
Dropping table TAB0...
insert average: 84025/s min: 83116/s max: 84934/s stddev: 1%
update average: 88570/s min: 88173/s max: 88967/s stddev: 0%
delete average: 101015/s min: 99415/s max: 102616/s stddev: 1%
read average: 93951/s min: 86777/s max: 98425/s stddev: 5%


7.2.6版本用的是CMAKE,这样编译:
cmake . -LH
cmake . \
-DBUILD_CONFIG=mysql_release \
-DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \
-DENABLE_DEBUG_SYNC:BOOL=off \
-DINSTALL_LAYOUT:STRING=STANDALONE \
-DWITH_BUNDLED_LIBEVENT:BOOL=off \
-DWITH_BUNDLED_MEMCACHED:BOOL=off \
-DCMAKE_INSTALL_PREFIX:PATH=$HOME/mysql \
-DMYSQL_DATADIR:PATH=$HOME/data \
-DWITH_NDB_PORT=1286 \
-DWITH_NDB_TEST:BOOL=on \
-DWITH_UNIT_TESTS:BOOL=off \
-L

make

make install




阅读(3388) | 评论(3) | 转发(0) |
给主人留下些什么吧!~~

mimangdexiaoniao2014-01-16 16:18:33

刚用了这句
/mysql/mysqlc718/bin/flexAsynch -t 1 -p 80 -l 2 -o 100 -c 100 -n
貌似因为我的dataMemory才分配了80M,所以满了,然后就卡住了。
我退出重新进来数据就一直存在我数据节点内存里,请问怎么可以删掉啊

mimangdexiaoniao2014-01-16 09:35:53

碰到了好多问题。希望可以和博主请教。

mimangdexiaoniao2014-01-16 09:35:22

最近进了一个公司在研究mysql的集群。
公司之前貌似没有研究过这一块,我现在是第一人了,亚历山大啊,求带领大神!