sysbench-0.4.12編譯安裝和CPU測(cè)試?yán)臃窒?/h1>
更新時(shí)間:2014年07月17日 09:33:34 投稿:junjie
這篇文章主要介紹了sysbench-0.4.12編譯安裝和CPU測(cè)試?yán)臃窒?本文還包含安裝過(guò)程中的錯(cuò)誤及解決方法,使用時(shí)的錯(cuò)誤和解決方法,需要的朋友可以參考下
一、獲取安裝包
最近的版本為0.4.12,下載地址:http://sourceforge.net/projects/sysbench/
二、編譯安裝
我的環(huán)境為RHEL6.2 + MySQL 5.6.16,搭建參考上兩篇文章<<RHEL6.2編譯安裝MySQL 5.6.16>><<MySQL Benchmark安裝DBI組件>>,安裝步驟如下:
復(fù)制代碼 代碼如下:
[root@beanvm ~]# tar -xvf sysbench-0.4.12.tar.gz
[root@beanvm ~]# cd sysbench-0.4.12
[root@beanvm sysbench-0.4.12]# ./configure --with-mysql-includes=/usr/local/mysql/include --with-mysql-libs=/usr/local/mysql/lib && make && make install
因?yàn)槲业腗ySQL是編譯安裝的,所以上面需要給出MySQL的庫(kù)文件位置(對(duì)應(yīng)—with—mysql-includes和–with-mysql-libs選項(xiàng))。
安裝過(guò)程中常見(jiàn)的報(bào)錯(cuò)如下:
復(fù)制代碼 代碼如下:
../libtool: line 841: X--tag=CC: command not found
../libtool: line 874: libtool: ignoring unknown tag : command not found
../libtool: line 841: X--mode=link: command not found
../libtool: line 1007: *** Warning: inferring the mode of operation is deprecated.: command not found
../libtool: line 1008: *** Future versions of Libtool will require --mode=MODE be specified.: command not found
../libtool: line 2234: X-g: command not found
../libtool: line 2234: X-O2: command not found
../libtool: line 1954: X-L/usr/local/mysql/lib: No such file or directory
../libtool: line 2403: Xsysbench: command not found
在之前版本中,碰見(jiàn)這個(gè)問(wèn)題我們只需要在編譯操作前執(zhí)行sysbench解壓目錄下的autogen.sh腳本即可;不過(guò)現(xiàn)在這樣做還是會(huì)報(bào)同樣的錯(cuò)誤,原因是sysbench自帶的libtool有問(wèn)題,我們可以比較它和/usr/bin/libtool文件的區(qū)別得知,總之可以通過(guò)替換這個(gè)libtool文件來(lái)解決,或者修改aclocal.m4文件的如下內(nèi)容
復(fù)制代碼 代碼如下:
# Always use our own libtool.
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
AC_SUBST(LIBTOOL)dnl
將LIBTOOL變量的值修改為:'$(SHELL) /usr/bin/libtool',即使用系統(tǒng)的libtool工具包。
修改后再執(zhí)行make && make install即可順利安裝。
安裝完成馬上測(cè)試一下:
復(fù)制代碼 代碼如下:
[root@beanvm sysbench-0.4.12]# sysbench
sysbench: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory
說(shuō)是缺少libmysqlclient.so.18文件,額,這個(gè)文件是存在的,需要手動(dòng)鏈接一下:
復(fù)制代碼 代碼如下:
[root@beanvm ~]# ls -l /usr/local/mysql/lib/libmysqlclient.so.18*
lrwxrwxrwx. 1 mysql mysql 24 Feb 15 14:39 /usr/local/mysql/lib/libmysqlclient.so.18 -> libmysqlclient.so.18.1.0
-rwxr-xr-x. 1 mysql mysql 7654927 Feb 15 14:30 /usr/local/mysql/lib/libmysqlclient.so.18.1.0
[root@beanvm ~]# ls -l /usr/lib/libmysqlclient.so.18*
ls: cannot access /usr/lib/libmysqlclient.so.18*: No such file or directory
[root@beanvm ~]# ln ln -s /usr/local/mysql/lib/libmysqlclient.so.18 /usr/lib/
部署完成,運(yùn)行一個(gè)CPU基準(zhǔn)測(cè)試:
復(fù)制代碼 代碼如下:
[root@beanvm ~]# sysbench --test=cpu --cpu-max-prime=20000 run
sysbench 0.4.12: multi-threaded system evaluation benchmark
Running the test with following options:
Number of threads: 1
Doing CPU performance benchmark
Threads started!
Done.
Maximum prime number checked in CPU test: 20000
Test execution summary:
total time: 40.4541s
total number of events: 10000
total time taken by event execution: 40.4165
per-request statistics:
min: 3.64ms
avg: 4.04ms
max: 21.82ms
approx. 95 percentile: 5.20ms
Threads fairness:
events (avg/stddev): 10000.0000/0.00
execution time (avg/stddev): 40.4165/0.00
相關(guān)文章
-
體驗(yàn)MySQL5.6.25并處理所遇到的問(wèn)題
本文給大家分享的是將mysql升級(jí)到5.6.25版本后所遇到的2個(gè)問(wèn)題的處理解決辦法,有需要的小伙伴可以參考下。 2015-07-07
-
Mysql數(shù)據(jù)庫(kù)介紹及mysql顯示命令
這篇文章主要介紹了Mysql數(shù)據(jù)庫(kù)介紹及mysql顯示命令 的相關(guān)資料,需要的朋友可以參考下 2016-04-04
-
MySQL主從復(fù)制問(wèn)題總結(jié)及排查過(guò)程
這篇文章主要介紹了MySQL主從復(fù)制問(wèn)題總結(jié)及排查過(guò)程,mysql主從是常用的高可用架構(gòu)之一,也是使用最廣泛的的系統(tǒng)架構(gòu)。在生產(chǎn)環(huán)境中mysql主從復(fù)制有時(shí)會(huì)出現(xiàn)復(fù)制錯(cuò)誤問(wèn)題。下文更多內(nèi)容需要的小伙伴可以參考一下 2022-03-03
-
Ubuntu Server下MySql數(shù)據(jù)庫(kù)備份腳本代碼
為了mysql數(shù)據(jù)庫(kù)的安全,我們需要定時(shí)備份mysql數(shù)據(jù)庫(kù),這里提供下腳本代碼,需要的朋友可以參考下 2013-06-06
-
MySQL數(shù)據(jù)庫(kù)表修復(fù) MyISAM
這篇文章主要介紹了MySQL數(shù)據(jù)庫(kù)表修復(fù) MyISAM ,需要的朋友可以參考下 2014-06-06
-
mysql?ON?DUPLICATE?KEY?UPDATE重復(fù)插入時(shí)更新方式
這篇文章主要介紹了mysql?ON?DUPLICATE?KEY?UPDATE重復(fù)插入時(shí)更新方式,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教 2022-07-07
最新評(píng)論
一、獲取安裝包
最近的版本為0.4.12,下載地址:http://sourceforge.net/projects/sysbench/
二、編譯安裝
我的環(huán)境為RHEL6.2 + MySQL 5.6.16,搭建參考上兩篇文章<<RHEL6.2編譯安裝MySQL 5.6.16>><<MySQL Benchmark安裝DBI組件>>,安裝步驟如下:
[root@beanvm ~]# tar -xvf sysbench-0.4.12.tar.gz
[root@beanvm ~]# cd sysbench-0.4.12
[root@beanvm sysbench-0.4.12]# ./configure --with-mysql-includes=/usr/local/mysql/include --with-mysql-libs=/usr/local/mysql/lib && make && make install
因?yàn)槲业腗ySQL是編譯安裝的,所以上面需要給出MySQL的庫(kù)文件位置(對(duì)應(yīng)—with—mysql-includes和–with-mysql-libs選項(xiàng))。
安裝過(guò)程中常見(jiàn)的報(bào)錯(cuò)如下:
../libtool: line 841: X--tag=CC: command not found
../libtool: line 874: libtool: ignoring unknown tag : command not found
../libtool: line 841: X--mode=link: command not found
../libtool: line 1007: *** Warning: inferring the mode of operation is deprecated.: command not found
../libtool: line 1008: *** Future versions of Libtool will require --mode=MODE be specified.: command not found
../libtool: line 2234: X-g: command not found
../libtool: line 2234: X-O2: command not found
../libtool: line 1954: X-L/usr/local/mysql/lib: No such file or directory
../libtool: line 2403: Xsysbench: command not found
在之前版本中,碰見(jiàn)這個(gè)問(wèn)題我們只需要在編譯操作前執(zhí)行sysbench解壓目錄下的autogen.sh腳本即可;不過(guò)現(xiàn)在這樣做還是會(huì)報(bào)同樣的錯(cuò)誤,原因是sysbench自帶的libtool有問(wèn)題,我們可以比較它和/usr/bin/libtool文件的區(qū)別得知,總之可以通過(guò)替換這個(gè)libtool文件來(lái)解決,或者修改aclocal.m4文件的如下內(nèi)容
# Always use our own libtool.
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
AC_SUBST(LIBTOOL)dnl
將LIBTOOL變量的值修改為:'$(SHELL) /usr/bin/libtool',即使用系統(tǒng)的libtool工具包。
修改后再執(zhí)行make && make install即可順利安裝。
安裝完成馬上測(cè)試一下:
[root@beanvm sysbench-0.4.12]# sysbench
sysbench: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory
說(shuō)是缺少libmysqlclient.so.18文件,額,這個(gè)文件是存在的,需要手動(dòng)鏈接一下:
[root@beanvm ~]# ls -l /usr/local/mysql/lib/libmysqlclient.so.18*
lrwxrwxrwx. 1 mysql mysql 24 Feb 15 14:39 /usr/local/mysql/lib/libmysqlclient.so.18 -> libmysqlclient.so.18.1.0
-rwxr-xr-x. 1 mysql mysql 7654927 Feb 15 14:30 /usr/local/mysql/lib/libmysqlclient.so.18.1.0
[root@beanvm ~]# ls -l /usr/lib/libmysqlclient.so.18*
ls: cannot access /usr/lib/libmysqlclient.so.18*: No such file or directory
[root@beanvm ~]# ln ln -s /usr/local/mysql/lib/libmysqlclient.so.18 /usr/lib/
部署完成,運(yùn)行一個(gè)CPU基準(zhǔn)測(cè)試:
[root@beanvm ~]# sysbench --test=cpu --cpu-max-prime=20000 run
sysbench 0.4.12: multi-threaded system evaluation benchmark
Running the test with following options:
Number of threads: 1
Doing CPU performance benchmark
Threads started!
Done.
Maximum prime number checked in CPU test: 20000
Test execution summary:
total time: 40.4541s
total number of events: 10000
total time taken by event execution: 40.4165
per-request statistics:
min: 3.64ms
avg: 4.04ms
max: 21.82ms
approx. 95 percentile: 5.20ms
Threads fairness:
events (avg/stddev): 10000.0000/0.00
execution time (avg/stddev): 40.4165/0.00
相關(guān)文章
體驗(yàn)MySQL5.6.25并處理所遇到的問(wèn)題
本文給大家分享的是將mysql升級(jí)到5.6.25版本后所遇到的2個(gè)問(wèn)題的處理解決辦法,有需要的小伙伴可以參考下。2015-07-07Mysql數(shù)據(jù)庫(kù)介紹及mysql顯示命令
這篇文章主要介紹了Mysql數(shù)據(jù)庫(kù)介紹及mysql顯示命令 的相關(guān)資料,需要的朋友可以參考下2016-04-04MySQL主從復(fù)制問(wèn)題總結(jié)及排查過(guò)程
這篇文章主要介紹了MySQL主從復(fù)制問(wèn)題總結(jié)及排查過(guò)程,mysql主從是常用的高可用架構(gòu)之一,也是使用最廣泛的的系統(tǒng)架構(gòu)。在生產(chǎn)環(huán)境中mysql主從復(fù)制有時(shí)會(huì)出現(xiàn)復(fù)制錯(cuò)誤問(wèn)題。下文更多內(nèi)容需要的小伙伴可以參考一下2022-03-03Ubuntu Server下MySql數(shù)據(jù)庫(kù)備份腳本代碼
為了mysql數(shù)據(jù)庫(kù)的安全,我們需要定時(shí)備份mysql數(shù)據(jù)庫(kù),這里提供下腳本代碼,需要的朋友可以參考下2013-06-06MySQL數(shù)據(jù)庫(kù)表修復(fù) MyISAM
這篇文章主要介紹了MySQL數(shù)據(jù)庫(kù)表修復(fù) MyISAM ,需要的朋友可以參考下2014-06-06mysql?ON?DUPLICATE?KEY?UPDATE重復(fù)插入時(shí)更新方式
這篇文章主要介紹了mysql?ON?DUPLICATE?KEY?UPDATE重復(fù)插入時(shí)更新方式,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2022-07-07