Linux DB

 Mysql banchmark tool – sysbanch 설치하기


hostway # wget http://sourceforge.net/projects/sysbench/files/sysbench/0.4.12/sysbench-0.4.12.tar.gz/download

hostway # tar xvfz sysbench-0.4.12.tar.gz

hostway # cd sysbench-0.4.12

hostway # ./autogen.sh

hostway # ./configure --prefix=/usr/local --with-mysql-includes=/usr/local/mysql/include/mysql --with-mysql-libs=/usr/local/mysql/lib/mysql

hostway # make && make install

 

# TEST DB 생성
hostway # mysql -u root -p

SQL> create database sbtest;
SQL> grant all on sbtest.* to
sbtest@localhost identified by 'sbtest' with grant option;
SQL>grant all on sbtest.* to sbtest identified by 'sbtest' with grant option;
SQL> flush privileges


# mysql.sock 파일 위치는 지정한 위치에 따라 다를 수 있습니다. Rpm 으로 설치 된 경우 /var/lib/mysql/mysql.sock


./sysbench --test=oltp --mysql-table-type=myisam --oltp-table-size=10000 --mysql-password=sbtest --mysql-socket=/tmp/mysql.sock prepare


#테스트 실행
./sysbench --num-threads=16 --max-requests=1000 --test=oltp --oltp-table-size=10000 --mysql-socket=/ tmp/mysql.sock --mysql-password=sbtest --oltp-read-only run