欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

sysbench的安裝與使用 分享

 更新時間:2013年09月26日 15:25:57   作者:  
sysbench是一款開源的多線程性能測試工具,可以執(zhí)行CPU/內(nèi)存/線程/IO/數(shù)據(jù)庫等方面的性能測試。數(shù)據(jù)庫目前支持MySQL/Oracle/PostgreSQL
安裝過程(rhel5.8+mysql5.5)
安裝過程中不斷報錯,參考了眾多網(wǎng)上資料,一上午時間才搞定
1,    環(huán)境準備,安裝相關軟件包,掛載光驅,配置yum
mount -o loop /data/rhel-server-5.9-x86_64-dvd.iso /mnt/cdrom
配置yum
vi /etc/yum.repos.d/rhel58.repo
[Server]
name=rhel58server
baseurl=file:///mnt/cdrom/Server/
enable=1
gpcheck=1
gpgkey=file:///mnt/cdrom/Server/RPM-GPG-KEY-redhat-release
2,    安裝相關軟件包,要不可能會報錯(注意要安裝mysql-devel)
yum install automake
yum install libtool
yum install zlib
yum install gcc
yum install  gcc glibc-devel  glibc-headers  glibc-kernheaders

3,    正式安裝
A,解壓縮
tar zxvf sysbench-0.4.8.tar.gz
b,修改配置文件
vi configure.ac
# Checks for programs.
AC_PROG_CC
#AC_PROG_LIBTOOL
AC_PROG_RANLIB
AX_CHECK_DOCBOOK
C,分別執(zhí)行如下命令,
./autogen.sh
./configure  --with-mysql-includes=/usr/include/mysql \
--with-mysql-libs=/usr/lib64/mysql \
LDFLAGS='-ldl'
make
makeinstall

安裝中的相關問題
1,copy config.guess and config.sub from /usr/share/libtool to current directory, then ./configure

2,報錯:報錯client_plugin.c:178: undefined reference to `dlclose' sysbench的問題
./config 命令添加LDFLAGS='-ldl'參數(shù)

具體測試方法

1、cpu性能測試

sysbench --test=cpu --cpu-max-prime=20000 run

cpu測試主要是進行素數(shù)的加法運算,在上面的例子中,指定了最大的素數(shù)為 20000,自己可以根據(jù)機器cpu的性能來適當調(diào)整數(shù)值。

2、線程測試

sysbench --test=threads --num-threads=64 --thread-yields=100 --thread-locks=2 run

3、磁盤IO性能測試

sysbench --test=fileio --num-threads=16 --file-total-size=3G --file-test-mode=rndrw prepare
sysbench --test=fileio --num-threads=16 --file-total-size=3G --file-test-mode=rndrw run
sysbench --test=fileio --num-threads=16 --file-total-size=3G --file-test-mode=rndrw cleanup

上述參數(shù)指定了最大創(chuàng)建16個線程,創(chuàng)建的文件總大小為3G,文件讀寫模式為隨機讀。

4、內(nèi)存測試

sysbench --test=memory --memory-block-size=8k --memory-total-size=4G run

上述參數(shù)指定了本次測試整個過程是在內(nèi)存中傳輸 4G 的數(shù)據(jù)量,每個 block 大小為 8K。

5、OLTP測試

sysbench --test=oltp --mysql-table-engine=innodb --mysql-user=root --db-driver=mysql --mysql-db=sbtest  --oltp-table-size=30000000 --oltp-table-name=t2 --oltp-nontrx-mode=insert --mysql-socket=/var/lib/mysql/mysql.sock prepare
sysbench --test=oltp --mysql-table-engine=innodb --mysql-user=root --db-driver=mysql --mysql-db=sbtest  --oltp-table-size=30000000 --oltp-table-name=t1  --mysql-socket=/var/lib/mysql/mysql.sock run

相關文章

最新評論