第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

PostgreSQL DBA(8) - sysbench簡(jiǎn)介

標(biāo)簽:
SQL Server

pgbench是一款开源的基准测试工具,支持多线程和多种数据库(包括MySQL、PostgreSQL等);通过测试可衡量操作系统的CPU、磁盘IO、内存、POSIX线程性能和数据库性能。

一、安装

下载sysbench,当前最新版本是1.0.15

cd /tmp/install
wget https://github.com/akopytov/sysbench/archive/1.0.15.zip -O "sysbench-1.0.15.zip"unzip sysbench-1.0.15.zipcd sysbench-1.0.15

执行安装

yum install automake libtool mysql-devel postgresql-devel –y
./autogen.sh
./configure --with-pgsql --with-pgsql-includes=/appdb/atlasdb/pg11beta2/include  --with-pgsql-libs=/appdb/atlasdb/pg11beta2/lib
make
make install

安装成功

[root@localhost sysbench-1.0.15]# sysbench --versionsysbench 1.0.15

二、参数说明

通过sysbench --help命令可以查看详细的参数设置.

[root@localhost include]# sysbench --helpUsage:
  sysbench [options]... [testname] [command]

Commands implemented by most tests: prepare run cleanup helpGeneral options:
  --threads=N                     number of threads to use [1]
...

其中:
oltp-tables-count
生成测试数据表数量

--threads=N
sysbench使用的工作线程数

--time=N
执行时长,以秒为单位

--report-interval=N
报告间隔,以秒为单位

--config-file=FILENAME
配置文件

--db-driver=STRING
数据库驱动mysql/pgsql

pgsql options:
--pgsql-host=STRING     PostgreSQL server host [localhost]
--pgsql-port=N          PostgreSQL server port [5432]
--pgsql-user=STRING     PostgreSQL user [sbtest]
--pgsql-password=STRING PostgreSQL password []
--pgsql-db=STRING       PostgreSQL database name [sbtest]

三、基本使用

连接数据库,创建测试数据库sysbench

$createdb sysbench

准备阶段
执行以下命令,sysbench执行自带的测试脚本

sysbench /usr/local/share/sysbench/tests/include/oltp_legacy/oltp.lua \
--oltp-tables-count=10 --oltp-table-size=500000 \
--db-driver=pgsql --pgsql-host=192.168.26.103 --pgsql-port=5432 \
--pgsql-user=atlasdb --pgsql-db=sysbench \
prepare

命令输出

Creating table 'sbtest1'...
Inserting 500000 records into 'sbtest1'Creating secondary indexes on 'sbtest1'...
Creating table 'sbtest2'...
Inserting 500000 records into 'sbtest2'Creating secondary indexes on 'sbtest2'...
Creating table 'sbtest3'...
Inserting 500000 records into 'sbtest3'Creating secondary indexes on 'sbtest3'...
Creating table 'sbtest4'...
Inserting 500000 records into 'sbtest4'Creating secondary indexes on 'sbtest4'...
Creating table 'sbtest5'...
Inserting 500000 records into 'sbtest5'Creating secondary indexes on 'sbtest5'...
Creating table 'sbtest6'...
Inserting 500000 records into 'sbtest6'Creating secondary indexes on 'sbtest6'...
Creating table 'sbtest7'...
Inserting 500000 records into 'sbtest7'Creating secondary indexes on 'sbtest7'...
Creating table 'sbtest8'...
Inserting 500000 records into 'sbtest8'Creating secondary indexes on 'sbtest8'...
Creating table 'sbtest9'...
Inserting 500000 records into 'sbtest9'Creating secondary indexes on 'sbtest9'...
Creating table 'sbtest10'...
Inserting 500000 records into 'sbtest10'Creating secondary indexes on 'sbtest10'..

运行基准测试

sysbench /usr/local/share/sysbench/tests/include/oltp_legacy/oltp.lua \
--report-interval=5 \
--threads=4 --time=120 --db-driver=pgsql --pgsql-host=192.168.26.103 --pgsql-port=5432 \
--pgsql-user=atlasdb --pgsql-db=sysbench \
run

执行完毕,4线程的执行过程和结果如下:

sysbench 1.0.15 (using bundled LuaJIT 2.1.0-beta2)

Running the test with following options:Number of threads: 4Report intermediate results every 5 second(s)
Initializing random number generator from current time


Initializing worker threads...

Threads started!

[ 5s ] thds: 4 tps: 107.50 qps: 2160.56 (r/w/o: 1513.97/430.79/215.80) lat (ms,95%): 51.94 err/s: 0.00 reconn/s: 0.00[ 10s ] thds: 4 tps: 80.79 qps: 1611.00 (r/w/o: 1126.26/323.16/161.58) lat (ms,95%): 71.83 err/s: 0.00 reconn/s: 0.00[ 15s ] thds: 4 tps: 105.45 qps: 2114.74 (r/w/o: 1482.66/421.19/210.89) lat (ms,95%): 61.08 err/s: 0.00 reconn/s: 0.00...
[ 120s ] thds: 4 tps: 88.00 qps: 1762.33 (r/w/o: 1232.95/353.39/175.99) lat (ms,95%): 77.19 err/s: 0.00 reconn/s: 0.00SQL statistics:
    queries performed:
        read:                            181496
        write:                           51856
        other:                           25928
        total:                           259280
    transactions:                        12964  (108.00 per sec.)
    queries:                             259280 (2160.08 per sec.)
    ignored errors:                      0      (0.00 per sec.)
    reconnects:                          0      (0.00 per sec.)

General statistics:
    total time:                          120.0312s
    total number of events:              12964Latency (ms):
         min:                                   18.34
         avg:                                   37.02
         max:                                  122.90
         95th percentile:                       58.92
         sum:                               479962.76Threads fairness:
    events (avg/stddev):           3241.0000/6.96
    execution time (avg/stddev):   119.9907/0.01



作者:EthanHe
链接:https://www.jianshu.com/p/b7044f6a625a


點(diǎn)擊查看更多內(nèi)容
TA 點(diǎn)贊

若覺(jué)得本文不錯(cuò),就分享一下吧!

評(píng)論

作者其他優(yōu)質(zhì)文章

正在加載中
  • 推薦
  • 1
  • 收藏
  • 共同學(xué)習(xí),寫下你的評(píng)論
感謝您的支持,我會(huì)繼續(xù)努力的~
掃碼打賞,你說(shuō)多少就多少
贊賞金額會(huì)直接到老師賬戶
支付方式
打開(kāi)微信掃一掃,即可進(jìn)行掃碼打賞哦
今天注冊(cè)有機(jī)會(huì)得

100積分直接送

付費(fèi)專欄免費(fèi)學(xué)

大額優(yōu)惠券免費(fèi)領(lǐng)

立即參與 放棄機(jī)會(huì)
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)

舉報(bào)

0/150
提交
取消