如何安裝使用sysbench

本篇文章為大家展示了如何安裝使用sysbench,內(nèi)容簡(jiǎn)明扼要并且容易理解,絕對(duì)能使你眼前一亮,通過(guò)這篇文章的詳細(xì)介紹希望你能有所收獲。

公司主營(yíng)業(yè)務(wù):網(wǎng)站制作、成都網(wǎng)站制作、移動(dòng)網(wǎng)站開(kāi)發(fā)等業(yè)務(wù)。幫助企業(yè)客戶真正實(shí)現(xiàn)互聯(lián)網(wǎng)宣傳,提高企業(yè)的競(jìng)爭(zhēng)能力。成都創(chuàng)新互聯(lián)公司是一支青春激揚(yáng)、勤奮敬業(yè)、活力青春激揚(yáng)、勤奮敬業(yè)、活力澎湃、和諧高效的團(tuán)隊(duì)。公司秉承以“開(kāi)放、自由、嚴(yán)謹(jǐn)、自律”為核心的企業(yè)文化,感謝他們對(duì)我們的高要求,感謝他們從不同領(lǐng)域給我們帶來(lái)的挑戰(zhàn),讓我們激情的團(tuán)隊(duì)有機(jī)會(huì)用頭腦與智慧不斷的給客戶帶來(lái)驚喜。成都創(chuàng)新互聯(lián)公司推出從化免費(fèi)做網(wǎng)站回饋大家。

yum -y install make automake libtool pkgconfig libaio-devel
yum -y install MySQL-devel openssl-devel
unzip sysbench-master.zip
 ./autogen.sh
./configure --with-mysql-includes=/usr/local/mysql/include --with-mysql-libs=/usr/local/mysql/lib
make && make install

需要設(shè)置環(huán)境變量

[root@dpcm01 sysbench-master]# sysbench
sysbench: error while loading shared libraries: libmysqlclient.so.20: cannot open shared object file: No such file or directory
[root@dpcm01 sysbench-master]# echo $LD_LIBRARY_PATH
[root@dpcm01 sysbench-master]# echo $LD_LIBRARY_PATH
[root@dpcm01 sysbench-master]# 
[root@dpcm01 sysbench-master]# export LD_LIBRARY_PATH=/usr/local/mysql/lib
[root@dpcm01 sysbench-master]# 
[root@dpcm01 sysbench-master]# sysbench
sysbench 1.1.0 (using bundled LuaJIT 2.1.0-beta3)
Reading the script from the standard input:
[root@dpcm01 lua]# sysbench oltp_read_write.lua  --mysql-socket=/data/mysql/mysql.sock --mysql-user=root --mysql-host=localhost \
> --mysql-user=root --mysql-host=localhost --mysql-password=123456 --tables=10 --table_size=100000 prepare
sysbench 1.1.0 (using bundled LuaJIT 2.1.0-beta3)
FATAL: unable to connect to MySQL server on socket '/data/mysql/mysql.sock', aborting...
FATAL: error 1049: Unknown database 'sbtest'
FATAL: `sysbench.cmdline.call_command' function failed: ./oltp_common.lua:88: connection creation failed
[root@dpcm01 lua]# sysbench oltp_read_write.lua  --mysql-socket=/data/mysql/mysql.sock --mysql-user=root --mysql-host=localhost --mysql-user=root --mysql-host=localhost --mysql-password=123456 --tables=10 --table_size=100000 prepare
sysbench 1.1.0 (using bundled LuaJIT 2.1.0-beta3)
Creating table 'sbtest1'...
Inserting 100000 records into 'sbtest1'
Creating a secondary index on 'sbtest1'...
Creating table 'sbtest2'...
Inserting 100000 records into 'sbtest2'
Creating a secondary index on 'sbtest2'...
Creating table 'sbtest3'...
Inserting 100000 records into 'sbtest3'
Creating a secondary index on 'sbtest3'...
Creating table 'sbtest4'...
Inserting 100000 records into 'sbtest4'
Creating a secondary index on 'sbtest4'...
Creating table 'sbtest5'...
Inserting 100000 records into 'sbtest5'
Creating a secondary index on 'sbtest5'...
Creating table 'sbtest6'...
Inserting 100000 records into 'sbtest6'
Creating a secondary index on 'sbtest6'...
Creating table 'sbtest7'...
Inserting 100000 records into 'sbtest7'
Creating a secondary index on 'sbtest7'...
Creating table 'sbtest8'...
Inserting 100000 records into 'sbtest8'
Creating a secondary index on 'sbtest8'...
Creating table 'sbtest9'...
Inserting 100000 records into 'sbtest9'
Creating a secondary index on 'sbtest9'...
Creating table 'sbtest10'...
Inserting 100000 records into 'sbtest10'
Creating a secondary index on 'sbtest10'...
[root@dpcm01 lua]# sysbench --threads=4 \
>         --time=20 \
>         --report-interval=5 \
>         --mysql-host=localhost \
>         --mysql-port=3306 \
>         --mysql-user=root \
>         --mysql-password=123456 --mysql-socket=/data/mysql/mysql.sock \
>          oltp_read_write.lua \
>         --tables=10 \
>         --table_size=100000 \
> run
sysbench 1.1.0 (using bundled LuaJIT 2.1.0-beta3)
Running the test with following options:
Number of threads: 4
Report intermediate results every 5 second(s)
Initializing random number generator from current time
Initializing worker threads...
Threads started!
[ 5s ] thds: 4 tps: 286.08 qps: 5732.71 (r/w/o: 4013.85/1145.90/572.95) lat (ms,95%): 23.95 err/s: 0.00 reconn/s: 0.00
[ 10s ] thds: 4 tps: 337.00 qps: 6740.74 (r/w/o: 4719.55/1347.19/673.99) lat (ms,95%): 23.10 err/s: 0.00 reconn/s: 0.00
[ 15s ] thds: 4 tps: 342.04 qps: 6838.71 (r/w/o: 4786.90/1367.74/684.07) lat (ms,95%): 23.10 err/s: 0.00 reconn/s: 0.00
[ 20s ] thds: 4 tps: 344.79 qps: 6893.70 (r/w/o: 4824.79/1379.34/689.57) lat (ms,95%): 24.38 err/s: 0.00 reconn/s: 0.00
SQL statistics:
    queries performed:
        read:                            91756
        write:                           26216
        other:                           13108
        total:                           131080
    transactions:                        6554   (327.39 per sec.)
    queries:                             131080 (6547.79 per sec.)
    ignored errors:                      0      (0.00 per sec.)
    reconnects:                          0      (0.00 per sec.)
Throughput:
    events/s (eps):                      327.3896
    time elapsed:                        20.0190s
    total number of events:              6554
Latency (ms):
         min:                                    4.88
         avg:                                   12.21
         max:                                  398.72
         95th percentile:                       23.95
         sum:                                79998.74
Threads fairness:
    events (avg/stddev):           1638.5000/9.10
    execution time (avg/stddev):   19.9997/0.00

上述內(nèi)容就是如何安裝使用sysbench,你們學(xué)到知識(shí)或技能了嗎?如果還想學(xué)到更多技能或者豐富自己的知識(shí)儲(chǔ)備,歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道。

本文名稱:如何安裝使用sysbench
標(biāo)題來(lái)源:http://bm7419.com/article24/ipojce.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供搜索引擎優(yōu)化、外貿(mào)網(wǎng)站建設(shè)、電子商務(wù)自適應(yīng)網(wǎng)站、網(wǎng)站改版、關(guān)鍵詞優(yōu)化

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

網(wǎng)站建設(shè)網(wǎng)站維護(hù)公司