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

sysbench的安裝與使用 分享

 更新時(shí)間:2013年09月26日 15:25:57   作者:  
sysbench是一款開(kāi)源的多線程性能測(cè)試工具,可以執(zhí)行CPU/內(nèi)存/線程/IO/數(shù)據(jù)庫(kù)等方面的性能測(cè)試。數(shù)據(jù)庫(kù)目前支持MySQL/Oracle/PostgreSQL
安裝過(guò)程(rhel5.8+mysql5.5)
安裝過(guò)程中不斷報(bào)錯(cuò),參考了眾多網(wǎng)上資料,一上午時(shí)間才搞定
1,    環(huán)境準(zhǔn)備,安裝相關(guān)軟件包,掛載光驅(qū),配置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,    安裝相關(guān)軟件包,要不可能會(huì)報(bào)錯(cuò)(注意要安裝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

安裝中的相關(guān)問(wèn)題
1,copy config.guess and config.sub from /usr/share/libtool to current directory, then ./configure

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

具體測(cè)試方法

1、cpu性能測(cè)試

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

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

2、線程測(cè)試

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

3、磁盤(pán)IO性能測(cè)試

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個(gè)線程,創(chuàng)建的文件總大小為3G,文件讀寫(xiě)模式為隨機(jī)讀。

4、內(nèi)存測(cè)試

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

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

5、OLTP測(cè)試

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

相關(guān)文章

最新評(píng)論