安装:
yum -y install make m4  autoconf automake libtool pkgconfig libaio-devel
rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm 
之后安装bzr
yum install bzr
获取sysbench 文件
bzr branch lp:sysbench 
export CC=cc
export CXX=c++
export CFLAGS="-m64 -I /u01/app/oracle/product/12.2.0.1/db_1/rdbms/public"
export CXXFLAGS="$CFLAGS"
export ORACLE_HOME=/u01/app/oracle/product/12.2.0.1/db_1
export LD_LIBRARY_PATH=/u01/app/oracle/product/12.2.0.1/db_1/lib
 
./configure --prefix=/usr/local/sysbench --with-oracle --libdir=/u01/app/oracle/product/12.2.0.1/db_1/lib --without-mysql
make ORA_LIBS=/u01/app/oracle/product/12.2.0.1/db_1/lib/libclntsh.so
make install
echo "export PATH=$PATH:/usr/local/sysbench/bin">>/etc/profile
source /etc/profile
 
一般语法
prepare   :用于文件IO和数据库OLTP测试的数据准备阶段。
run       :性能测试阶段
cleanup   :移除测试过程中产生的数据
cpu性能测试
--test=cpu                --指明要测试的是CPU 
--cpu-max-prime           --最大的素数 
--max-requests=20         --最大的请求次数, 
--max-time=20             --最长允许执行时间,这只是一个软阀值
                      
sysbench --test=cpu  --cpu-max-prime=20000 run 
sysbench 0.5:  multi-threaded system evaluation benchmark
Running the test with following options:
Number of threads: 1
Random number generator seed is 0 and will be ignored
Primer numbers limit: 20000
Threads started!
General statistics:
    total time:                          29.2874s         --总运行时间 
    total number of events:              10000            --循环的次数 
    total time taken by event execution: 29.2790s         --循环的执行时间 
    response time:                                       
         min:                                  2.82ms     --最小单次执行时间 
         avg:                                  2.93ms     --平均单次执行时间 
         max:                                  3.83ms     --最长单次执行时间 
         approx.  95 percentile:               3.18ms     --除去最高的5%剩余的95%中最长的执行时间
Threads fairness:
    events (avg/stddev):           10000.0000/0.00
    execution time (avg/stddev):   29.2790/0.00
   
[root@oracle1 ~]# sysbench --test=cpu  --cpu-max-prime=5000  --max-requests=20  run 
sysbench 0.5:  multi-threaded system evaluation benchmark
Running the test with following options:
Number of threads: 1
Random number generator seed is 0 and will be ignored
Primer numbers limit: 5000
Threads started!
General statistics:
    total time:                          0.0099s
    total number of events:              20
    total time taken by event execution: 0.0098s
    response time:
         min:                                  0.44ms
         avg:                                  0.49ms
         max:                                  0.53ms
         approx.  95 percentile:               0.53ms
Threads fairness:
    events (avg/stddev):           20.0000/0.00
    execution time (avg/stddev):   0.0098/0.00
--max-time=20     
--最长允许执行时间,这只是一个软阀值,虽然设置为20,结果还是跑了25秒 
--感觉类似于一个任务开始之前,看一下之前所执行的任务用了多久,如果没有超过max-time,则开启次任务,任务一旦开启不会自动终止,一直要等到跑完 
[root@oracle1 ~]# sysbench --test=cpu  --cpu-max-prime=5000000  --max-time=20  run
sysbench 0.5:  multi-threaded system evaluation benchmark
Running the test with following options:
Number of threads: 1
Random number generator seed is 0 and will be ignored
Primer numbers limit: 5000000
Threads started!
General statistics:
    total time:                          20.7888s
    total number of events:              3
    total time taken by event execution: 20.7886s
    response time:
         min:                               6906.44ms
         avg:                               6929.54ms
         max:                               6955.42ms
         approx.  95 percentile:            6954.54ms
Threads fairness:
    events (avg/stddev):           3.0000/0.00
    execution time (avg/stddev):   20.7886/0.00
   
THREADS性能测试
--test=threads            --指明测试内容为tread 
--num-threads=20          --创建多少个进程 
--thread-yields=500       --每次请求的压力 官方文档是说 锁定-释放CPU-解锁  但是这个yelid没搞清楚是什么操作 
--thread-locks= 222       --需要创建的mutex的数量
[root@oracle1 ~]# sysbench --test=threads --num-threads=20  --thread-yields=500  --thread-locks=2222  run 
sysbench 0.5:  multi-threaded system evaluation benchmark
Running the test with following options:
Number of threads: 20
Random number generator seed is 0 and will be ignored
Threads started!
General statistics:
    total time:                          0.5511s
    total number of events:              10000
    total time taken by event execution: 11.0062s
    response time:
         min:                                  0.11ms
         avg:                                  1.10ms
         max:                                 33.97ms
         approx.  95 percentile:               3.79ms
Threads fairness:
    events (avg/stddev):           500.0000/708.16
    execution time (avg/stddev):   0.5503/0.00
MUTEX性能测试   
--num-threads  --进程的数量 
--mutex-num    --mutex的数量 
--mutex-locks  --每次请求的mutex lock的数量 
--mutex-loops  --申请lock之前执行ok那个循环的次数
[root@oracle1 ~]# sysbench --test=mutex --num-threads=12 --mutex-num=10240  --mutex-locks=1000000 --mutex-loops=50000000 run
sysbench 0.5:  multi-threaded system evaluation benchmark
Running the test with following options:
Number of threads: 12
Random number generator seed is 0 and will be ignored
Threads started!
General statistics:
    total time:                          2.6958s
    total number of events:              12
    total time taken by event execution: 32.1176s
    response time:
         min:                               2611.74ms
         avg:                               2676.47ms
         max:                               2695.62ms
         approx.  95 percentile:            2694.17ms
Threads fairness:
    events (avg/stddev):           1.0000/0.00
    execution time (avg/stddev):   2.6765/0.02
MEMORY性能测试   
[root@oracle1 ~]# sysbench --test=memory help  
sysbench 0.5:  multi-threaded system evaluation benchmark
memory options: 
  --memory-block-size=SIZE    size of memory block for test [1K]                    --内存块的大小 
  --memory-total-size=SIZE    total size of data to transfer [100G]                 --操纵内存的总体数量 
  --memory-scope=STRING       memory access scope {global,local} [global]           --内存的访问范围 
  --memory-hugetlb=[on|off]   allocate memory from HugeTLB pool [off]               --是否从HUGEPAGE中分配内存 
  --memory-oper=STRING        type of memory operations {read, write, none} [write] --内存操作方式读或者写 
  --memory-access-mode=STRING memory access mode {seq,rnd} [seq]                    --内存访问方式 顺序还是随机
[root@oracle1 ~]# sysbench --test=memory --memory-block-size=8k --memory-total-size=100G --memory-access-mode=seq run
sysbench 0.5:  multi-threaded system evaluation benchmark
Running the test with following options:
Number of threads: 1
Random number generator seed is 0 and will be ignored
Threads started!
Operations performed: 13107200 (1128103.89 ops/sec)
102400.00 MB transferred (8813.31 MB/sec)
General statistics:
    total time:                          11.6188s
    total number of events:              13107200
    total time taken by event execution: 9.6169s
    response time:
         min:                                  0.00ms
         avg:                                  0.00ms
         max:                                  0.12ms
         approx.  95 percentile:               0.00ms
Threads fairness:
    events (avg/stddev):           13107200.0000/0.00
    execution time (avg/stddev):   9.6169/0.00
   
   
FILEIO性能测试       
   
--test=fileio           测试类型为fileio 
--file-num=256          测试文件数量  
--file-block-size=8K    每个块大小 
--file-total-size=2G    测试文件总大小 
--file-test-mode=rndrw  测试模式   
[root@oracle1 ~]# sysbench  --test=fileio --file-num=256  --file-block-size=8K --file-total-size=2G --file-test-mode=rndrw   prepare    
sysbench 0.5:  multi-threaded system evaluation benchmark
256 files, 8192Kb each, 2048Mb total
Creating files for the test...
Extra file open flags: 0
Creating file test_file.0
Creating file test_file.1
Creating file test_file.2
Creating file test_file.3
Creating file test_file.4
Creating file test_file.5
Creating file test_file.6
Creating file test_file.7
Creating file test_file.8
Creating file test_file.9
Creating file test_file.10
Creating file test_file.11
Creating file test_file.12
Creating file test_file.13
Creating file test_file.14
Creating file test_file.15
Creating file test_file.16
Creating file test_file.17
Creating file test_file.18
Creating file test_file.19
Creating file test_file.20
Creating file test_file.21
Creating file test_file.22
Creating file test_file.23
Creating file test_file.24
Creating file test_file.25
Creating file test_file.26
Creating file test_file.27
Creating file test_file.28
Creating file test_file.29
Creating file test_file.30
Creating file test_file.31
Creating file test_file.32
Creating file test_file.33
Creating file test_file.34
Creating file test_file.35
Creating file test_file.36
Creating file test_file.37
Creating file test_file.38
Creating file test_file.39
Creating file test_file.40
Creating file test_file.41
Creating file test_file.42
Creating file test_file.43
Creating file test_file.44
Creating file test_file.45
Creating file test_file.46
Creating file test_file.47
Creating file test_file.48
Creating file test_file.49
Creating file test_file.50
Creating file test_file.51
Creating file test_file.52
Creating file test_file.53
Creating file test_file.54
Creating file test_file.55
Creating file test_file.56
Creating file test_file.57
Creating file test_file.58
Creating file test_file.59
Creating file test_file.60
Creating file test_file.61
Creating file test_file.62
Creating file test_file.63
Creating file test_file.64
Creating file test_file.65
Creating file test_file.66
Creating file test_file.67
Creating file test_file.68
Creating file test_file.69
Creating file test_file.70
Creating file test_file.71
Creating file test_file.72
Creating file test_file.73
Creating file test_file.74
Creating file test_file.75
Creating file test_file.76
Creating file test_file.77
Creating file test_file.78
Creating file test_file.79
Creating file test_file.80
Creating file test_file.81
Creating file test_file.82
Creating file test_file.83
Creating file test_file.84
Creating file test_file.85
Creating file test_file.86
Creating file test_file.87
Creating file test_file.88
Creating file test_file.89
Creating file test_file.90
Creating file test_file.91
Creating file test_file.92
Creating file test_file.93
Creating file test_file.94
Creating file test_file.95
Creating file test_file.96
Creating file test_file.97
Creating file test_file.98
Creating file test_file.99
Creating file test_file.100
Creating file test_file.101
Creating file test_file.102
Creating file test_file.103
Creating file test_file.104
Creating file test_file.105
Creating file test_file.106
Creating file test_file.107
Creating file test_file.108
Creating file test_file.109
Creating file test_file.110
Creating file test_file.111
Creating file test_file.112
Creating file test_file.113
Creating file test_file.114
Creating file test_file.115
Creating file test_file.116
Creating file test_file.117
Creating file test_file.118
Creating file test_file.119
Creating file test_file.120
Creating file test_file.121
Creating file test_file.122
Creating file test_file.123
Creating file test_file.124
Creating file test_file.125
Creating file test_file.126
Creating file test_file.127
Creating file test_file.128
Creating file test_file.129
Creating file test_file.130
Creating file test_file.131
Creating file test_file.132
Creating file test_file.133
Creating file test_file.134
Creating file test_file.135
Creating file test_file.136
Creating file test_file.137
Creating file test_file.138
Creating file test_file.139
Creating file test_file.140
Creating file test_file.141
Creating file test_file.142
Creating file test_file.143
Creating file test_file.144
Creating file test_file.145
Creating file test_file.146
Creating file test_file.147
Creating file test_file.148
Creating file test_file.149
Creating file test_file.150
Creating file test_file.151
Creating file test_file.152
Creating file test_file.153
Creating file test_file.154
Creating file test_file.155
Creating file test_file.156
Creating file test_file.157
Creating file test_file.158
Creating file test_file.159
Creating file test_file.160
Creating file test_file.161
Creating file test_file.162
Creating file test_file.163
Creating file test_file.164
Creating file test_file.165
Creating file test_file.166
Creating file test_file.167
Creating file test_file.168
Creating file test_file.169
Creating file test_file.170
Creating file test_file.171
Creating file test_file.172
Creating file test_file.173
Creating file test_file.174
Creating file test_file.175
Creating file test_file.176
Creating file test_file.177
Creating file test_file.178
Creating file test_file.179
Creating file test_file.180
Creating file test_file.181
Creating file test_file.182
Creating file test_file.183
Creating file test_file.184
Creating file test_file.185
Creating file test_file.186
Creating file test_file.187
Creating file test_file.188
Creating file test_file.189
Creating file test_file.190
Creating file test_file.191
Creating file test_file.192
Creating file test_file.193
Creating file test_file.194
Creating file test_file.195
Creating file test_file.196
Creating file test_file.197
Creating file test_file.198
Creating file test_file.199
Creating file test_file.200
Creating file test_file.201
Creating file test_file.202
Creating file test_file.203
Creating file test_file.204
Creating file test_file.205
Creating file test_file.206
Creating file test_file.207
Creating file test_file.208
Creating file test_file.209
Creating file test_file.210
Creating file test_file.211
Creating file test_file.212
Creating file test_file.213
Creating file test_file.214
Creating file test_file.215
Creating file test_file.216
Creating file test_file.217
Creating file test_file.218
Creating file test_file.219
Creating file test_file.220
Creating file test_file.221
Creating file test_file.222
Creating file test_file.223
Creating file test_file.224
Creating file test_file.225
Creating file test_file.226
Creating file test_file.227
Creating file test_file.228
Creating file test_file.229
Creating file test_file.230
Creating file test_file.231
Creating file test_file.232
Creating file test_file.233
Creating file test_file.234
Creating file test_file.235
Creating file test_file.236
Creating file test_file.237
Creating file test_file.238
Creating file test_file.239
Creating file test_file.240
Creating file test_file.241
Creating file test_file.242
Creating file test_file.243
Creating file test_file.244
Creating file test_file.245
Creating file test_file.246
Creating file test_file.247
Creating file test_file.248
Creating file test_file.249
Creating file test_file.250
Creating file test_file.251
Creating file test_file.252
Creating file test_file.253
Creating file test_file.254
Creating file test_file.255
2147483648 bytes written in 15.87 seconds (129.06 MB/sec).
[root@oracle1 ~]#
[root@oracle1 ~]# sysbench  --test=fileio --file-num=256  --file-block-size=8K --file-total-size=2G --file-test-mode=rndrw  run 
sysbench 0.5:  multi-threaded system evaluation benchmark
Running the test with following options:
Number of threads: 1
Random number generator seed is 0 and will be ignored
Extra file open flags: 0
256 files, 8Mb each
2Gb total file size
Block size 8Kb
Number of IO requests: 10000
Read/Write ratio for combined random IO test: 1.50
Periodic FSYNC enabled, calling fsync() each 100 requests.
Calling fsync() at the end of test, Enabled.
Using synchronous I/O mode
Doing random r/w test
Threads started!
Operations performed:  6000 reads, 4000 writes, 25600 Other = 35600 Total
Read 46.875Mb  Written 31.25Mb  Total transferred 78.125Mb  (9.3936Mb/sec)
 1202.38 Requests/sec executed
General statistics:
    total time:                          8.3168s              --总运行时间 
    total number of events:              10000                --测试次数 
    total time taken by event execution: 0.2969s              --其中纯花费在测试上的时间 
    response time:                                          
         min:                                  0.00ms         --最小时间 
         avg:                                  0.03ms         --平均时间 
         max:                                  4.49ms         --最大时间 
         approx.  95 percentile:               0.16ms         --去除最高的5%后的最大时间 
Threads fairness:
    events (avg/stddev):           10000.0000/0.00
    execution time (avg/stddev):   0.2969/0.00
   
[root@oracle1 ~]# sysbench  --test=fileio --file-num=256  --file-block-size=8K --file-total-size=2G --file-test-mode=rndrw   cleanup  
sysbench 0.5:  multi-threaded system evaluation benchmark
Removing test files...

sysbench压测Oracle的更多相关文章

  1. sysbench对MySQL的压测,使用sysbench压测磁盘io

    QPS - query per secondTPS - transaction per second 不是特别关注,每个业务场景中事务标准是不一样的 Ⅰ.sysbench测试框架 Ⅱ.常用测试脚本 [ ...

  2. 05:Sysbench压测-innodb_deadlock_detect参数对性能的影响

    目录 sysbench压测-innodb_deadlock_detect参数对性能的影响 一.OLTP测试前准备 二.进行OLTP测试 三.测试结果解读: 四.关于测试后的结论: 五.关于测试后的性能 ...

  3. 04:Sysbench压测-innodb_flush_log_at_trx_commit,sync_binlog参数对性能的影响

    目录 sysbench压测-innodb_flush_log_at_trx_commit,sync_binlog参数对性能的影响 一.OLTP测试前准备 二.MySQL 数据落盘的过程 三.参数说明 ...

  4. 用sysbench压测MySQL,通过orzdba监控MySQL

    1.1 安装sysbench wget https://codeload.github.com/akopytov/sysbench/zip/0.5 unzip 0.5 cd sysbench-0.5/ ...

  5. sysbench压测过程

    1.sysbench安装(sysbench1.1.0)  [root@master soft]# ls sysbench1.1.0.zip sysbench1.1.0.zip 解压: [root@ma ...

  6. 【MySQL】sysbench压测服务器及结果解读

    主要压测范围包括CPU测试.磁盘IO测试.线程测试.OLTP测试等,那么sysbench就可以满足我们的压测需求.下面我们简单来看下sysbench的安装使用以及压测结果的解读. 一.sysbench ...

  7. sysbench 压测

    IP架构 sysbench部署服务器:172.17.100.107 压测服务器:172.17.100.100 MySQL部署目录:/usr/local/mysql 前置工作 1.完成MySQL的安装( ...

  8. sysbench压测自装MySQL数据库

    压测准备 测试机器 2vCPUs | 4GB | s6.large.2 CentOS 7.6 64bit 建立测试库 create database test_db character set utf ...

  9. 使用sysbench压测磁盘io

    Ⅰ.sysbench安装 cd /usr/local/src yum -y install make automake libtool pkgconfig libaio-devel git clone ...

随机推荐

  1. Elasticsearch中JAVA API的使用

    1.Elasticsearch中Java API的简介 Elasticsearch 的Java API 提供了非常便捷的方法来索引和查询数据等. 通过添加jar包,不需要编写HTTP层的代码就可以开始 ...

  2. DIV+CSS两种盒子模型(W3C盒子与IE盒子)

    在辨析两种盒子模型之前.先简单说明一下什么叫盒子模型. 原理: 先说说我们在网页设计中常听的属性名:内容(content).填充(padding).边框(border).边界(margin), CSS ...

  3. ubuntu-文件管理、编辑

    1.创建单层文件夹 mkdir test 如果你想要创建多层文件夹,这时候你需要添加一个参数-p mkdir -p t1/t2/t3 如果你不加-p的话,它会提示说找不到目录 2.分屏查看内容 mor ...

  4. 自己在linux上编译、链接、动态库和静态库的学习笔记

    在平常的项目中,我们都是使用公司要求的makefile.makedebug一类的文件,因此,在编译.链接.生成和链接动态库与静态库的时候,我们只是简单的使用一些已经设置的变量,只是简单的修改.添加一些 ...

  5. Node.js笔记 http fs

    const http=require('http'); const fs=require('fs'); var server = http.createServer(function(req, res ...

  6. sql server备份与还原 sql语句

    USE master DECLARE tb CURSOR LOCAL FOR SELECT 'Kill '+ CAST(Spid AS VARCHAR) FROM master.dbo.sysproc ...

  7. iOS ERROR: unable to get the receiver data from the DB 解决方式

    这个错误通常发生在iOS7其中,可能是缓存的导致的问题. 解决步骤: 右击Finder,选择 Go to Folder 复制上:"~/Library/Application Support/ ...

  8. Traveler Nobita (zoj 3456 最小生成树)

    Traveler Nobita Time Limit: 2 Seconds      Memory Limit: 65536 KB One day, Nobita used a time machin ...

  9. JS学习笔记 - 封装getPosition函数、一串跟着鼠标的div

    function getPosition(ev) { var scrollTop = document.documentElement.scrollTop || document.body.scrol ...

  10. qemu 参数简介

    参数 示例 说明 -hda -hda /data/windows.img 指定windows.img作为硬盘镜像 -cdrom -cdrom /data/windows.iso 指定windows.i ...