flexasynch mysql_How to use flexAsynch for performance testing with MySQL Cluster

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

http://www.gnu.org/software/make/.

* autoconf 2.58 (or newer), available from

http://www.gnu.org/software/autoconf/.

* automake 1.8.1, available from

http://www.gnu.org/software/automake/.

* libtool 1.5, available from

http://www.gnu.org/software/libtool/. 1.5.24 or later is

recommended.

* m4, available from http://www.gnu.org/software/m4/.

* bison, available from http://www.gnu.org/software/bison/. 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

阅读(2837) | 评论(3) | 转发(0) |

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值