首页 >数据库文件存储 >最佳实践 >Oracle RAC最佳实践

Oracle RAC最佳实践

本文档主要为用户讲解,如何基于阿里云DBFS数据库文件系统来搭建Oracle RAC集群。

Oracle RAC集群除了支持ASM(Automatic Storage Management)作为集群的共享存储软件外,还支持第三方的集群文件系统CFS(Clustered File System),如Veritas Cluster File System,GPFS,OCFS2等。

阿里云也推出了自己的文件系统DBFS,以方便用户将传统基于SAN构建的数据库或应用无缝的搬迁和集成到阿里云。阿里云DBFS企业版基于阿里云共享ESSD,用户不需要申请共享ESSD,由DBFS对用户的共享ESSD进行管理,具体说明请参考DBFS帮助文档。DBFS相比于ASM,有以下优势:

比较项

Oracle ASM

DBFS(数据库文件系统)

容量

10TB级。扩容需要加盘,rebalance的过程中将影响业务I/O,通常需要额外安排系统维护的时间窗口。

支持PB级。在线扩容,对用户透明。

文件类型

支持Voting Disk。不支持存放Oracle Home及Oracle Grid的二进制文件。

支持所有文件。支持存放Oracle Home及Oracle Grid的二进制文件,数据文件,控制文件,redo文件,OCR及Voting Disk等。

易用性

感知底层磁盘,需要配置Disk Group及冗余度。

持载即用。

性能

性能好,接近RAW I/O。

性能好,接近RAW I/O。针对数据库优化。

通用性

一般仅使用于Oracle数据库场景。

支持POSIX协议的通用数据库文件系统。不仅适用于数据库,也可适用于传统其它基于SAN构建的应用集群。

数据库场景:传统数据库如Oracle,SAP HANA等;开源数据库如MySQL,PostgreSQL,MongoDB等。

应用场景:中间件高可用集群及Oracle EBS套件。

image.png

以下为基于DBFS企业版部署Oracle RAC 11gR2的过程,本文档仅供用户参考,不替代Oracle RAC Grid及Oracle database官方的安装文档。

1、集群环境准备

1.1 ECS创建

以下为本次部署Oracle RAC集群的ECS实例规格,用户可以根据自己需要进行调整。

hostname

实例规格族

实例规格

OS版本

db00

ecs.g7se

ecs.g7se.large

Alibaba Cloud Linux 2.1903 LTS 64位

db01

ecs.g7se

ecs.g7se.large

Alibaba Cloud Linux 2.1903 LTS 64位

1.2 网络规划

IP资源划分如下,并为每台ECS增加一张弹性网卡,用于Oracle RAC私网通信。网络段的规划可按用户自己的真实情况进行调整,这里仅供参考。

hostname

公网IP

VIP

私网IP(新增的弹性网卡)

db00

172.19.143.106

172.19.143.104 db00-vip

192.168.0.10 db00-priv

db01

172.19.143.107

172.19.143.105 db01-vip

192.168.0.11 db01-priv

scan-ip 172.19.143.110 (Oracle RAC Scan IP,为db00/db01共用)。

编辑两台ECS的/etc/hosts文件:

#公网IP
172.19.143.106  db00
172.19.143.107  db01

#Oracle VIP
172.19.143.104  db00-vip
172.19.143.105  db01-vip

#Oracle Scan IP
172.19.143.110  scan-ip

#Oracle Private IP
192.168.0.10    db00-priv
192.168.0.11    db01-priv

1.3 创建DBFS

进入到DBFS的控制台,创建好DBFS后,分别挂载到两台ECS上,用作于Oracle RAC的共享存储。

image.png

1.4 存储规划

本地目录使用规划,这里仅供参考。用户可根据自己的场景进行调整,也可将其放到DBFS上。

本地目录名称

文件系统类型

共享

用途

/u01/app/oracle

ext4

ORACLE_BASE目录

/u01/app/product/11.2.0/oracle

ext4

ORACLE_HOME目录

/u01/app/grid

ext4

GRID_BASE目录

/u01/app/11.2.0/grid

ext4

GRID_HOME目录

/u01/app/oraInventory

ext4

Oracle Inventory目录

DBFS共享存储使用规划,用户可根据真实场景进行调整,这里仅供参考:

共享目录名称

用途

/mnt/dbfs/4actlq1dobrf/dbfs-AvCZfFP8QNWHBxl8vJkN6Q/ocr/

存储OCR文件。

/mnt/dbfs/4actlq1dobrf/dbfs-AvCZfFP8QNWHBxl8vJkN6Q/voting_disk/

存储Voting Disk。

/mnt/dbfs/4actlq1dobrf/dbfs-AvCZfFP8QNWHBxl8vJkN6Q/ordata/

存储数据文件,控制文件,redo及archive log等。

1.5 软件版本

组件

版本号

备注

Oracle Grid

11.2.0.4

Oracle集群软件

Oracle Database

11.2.0.4

Oracle数据库软件

2、设置Multicast功能

以下分别对两台ECS作multicast功能配置。

2.1 安装Multicast

下载multicast代理:

https://github.com/aliyun/multicast_proxy

选择multicast_kernel目录,分别生成server端和client端:

sh tmcc_client_auto_rpm.sh
sh tmcc_server_auto_rpm.sh

安装multicast RPM包:

rpm -Uvh multi_server-1.1-1.x86_64.rpm
rpm -Uvh multi_client-1.1-1.x86_64.rpm

2.2 启动Multicast

配置开机启动:

chkconfig multis on --level 2345
chkconfig multis off --level 016
chkconfig multic on --level 2345
chkconfig multic off --level 016

启动服务:

service multis start
service multic start

2.3 配置Multicast

对两台ECS的公网以及私网分别设置multicast功能。

配置组播服务端:

#node1
/usr/local/sbin/multis_admin -A -m 224.0.0.251 -j $node2_ip
/usr/local/sbin/multis_admin -A -m 230.0.1.0 -j $node2_ip

#node2
/usr/local/sbin/multis_admin -A -m 224.0.0.251 -j $node1_ip
/usr/local/sbin/multis_admin -A -m 230.0.1.0 -j $node1_ip

配置组播客户端:

#node1
/usr/local/sbin/multic_admin -A -i $node2_ip -p 0 -m 224.0.0.251
/usr/local/sbin/multic_admin -A -i $node2_ip -p 0 -m 230.0.1.0  
#node2
/usr/local/sbin/multic_admin -A -i $node1_ip -p 0 -m 224.0.0.251
/usr/local/sbin/multic_admin -A -i $node1_ip -p 0 -m 230.0.1.0

查看配置情况:

multis_admin -L -m 224.0.0.251
multis_admin -L -m 230.0.1.0
multic_admin -L

3、安装Oracle RAC Grid

除了以下两步外,其它的安装步骤与官方文档一样。DBFS也支持用于存放Oracle RAC Grid的home。在安装Oracle RAC Grid之前通常需要做OS参数调整及软件依赖包安装等,这些例行步骤在这里不再赘述。

3.1 配置OCR文件

以下步骤将Oracle Grid的OCR文件存放于DBFS上。选择“Shared File System”,继续下一步。

image.png

选择OCR的存储位置:

image.png

点击“Next”,出现下面界面,继续点击“Yes”,完成OCR配置。

image.png

3.2 配置Voting Disk

以下步骤将Oracle Grid的Voting Disk存放于DBFS上。

image.png

点击“Next”,出现下面界面,继续点击“Yes”,完成Voting Disk配置。

image.png

3.4 创建集群服务

在安装到最后,执行root.sh脚本时,会有超时问题,为已知的这个Oracle版本的安装bug。解决方法是,打开另外一个Shell窗口,在执行root.sh前,执行以下命令:

/bin/dd if=/var/tmp/.oracle/npohasd of=/dev/null bs=1024 count=1

3.5 检查集群服务

安装完成Oracle Grid后,查看服务运行情况:

[root@db00 dbfs-AvCZfFP8QNWHBxl8vJkN6Q]# crsctl stat res -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS       
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.asm
               OFFLINE OFFLINE      db00                     Instance Shutdown   
               OFFLINE OFFLINE      db01                                         
ora.gsd
               OFFLINE OFFLINE      db00                                         
               OFFLINE OFFLINE      db01                                         
ora.net1.network
               ONLINE  ONLINE       db00                                         
               ONLINE  ONLINE       db01                                         
ora.ons
               ONLINE  ONLINE       db00                                         
               ONLINE  ONLINE       db01                                         
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       db00                                         
ora.cvu
      1        ONLINE  ONLINE       db00                                         
ora.db00.vip
      1        ONLINE  ONLINE       db00                                         
ora.db01.vip
      1        ONLINE  ONLINE       db01                                         
ora.oc4j
      1        ONLINE  ONLINE       db00                                         
ora.scan1.vip
      1        ONLINE  ONLINE       db00                 

4、安装Oracle RAC数据库

除以下步骤外,其它步骤与Oracle官方文档一样。DBFS也支持用于存放Oracle数据库的home。在安装Oracle RAC Dabase之前通常需要做OS参数调整及软件依赖包安装等,这些例行步骤在这里不再赘述。

4.1 安装时配置数据文件

以下步骤将Oracle数据库的数据文件,控制文件,redo等其它文件存放于DBFS上。

在第一个选项“File System”中选择之前DBFS挂载的目录。

image.png

4.2 DBCA配置数据文件

如果用户使用DBCA创建数据库,则存储做如下配置即可。

image.png

4.3 启动数据库实例

需要按以下设置集群通信参数后,才能同时拉起两个实例,否则报以下错误。为Oracle RAC的例行配置,这里记录仅用于方便用户参考。

kjzdattdlm: Can not attach to DLM (LMON up=[TRUE], DB mounted=[FALSE]).

登录已经拉起的数据库实例,进行参数设置:

SQL> alter system set cluster_interconnects='192.168.0.10' scope=spfile sid='test1';

System altered.

SQL> alter system set cluster_interconnects='192.168.0.11' scope=spfile sid='test2';

System altered.

关闭已经拉起的数据库实例,重新拉起所有RAC数据库实例:

#关闭所有RAC数据库实例
srvctl stop database -d test

#拉起所有RAC数据库实例
srvctl start database -d test

5、集群服务检查

安装完成后来检查集群各项服务功能是否正常。

5.1 基础组件

[root@db00 ~]# crsctl check crs
CRS-4638: Oracle High Availability Services is online
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online

5.2 集群资源

安装完成后,查看集群所有资源的状态:

[root@db00 ~]# crs_stat  -t -v
Name           Type           R/RA   F/FT   Target    State     Host        
----------------------------------------------------------------------
ora....ER.lsnr ora....er.type 0/5    0/     ONLINE    ONLINE    db00        
ora....N1.lsnr ora....er.type 0/5    0/0    ONLINE    ONLINE    db00        
ora.asm        ora.asm.type   0/5    0/     OFFLINE   OFFLINE               
ora.cvu        ora.cvu.type   0/5    0/0    ONLINE    ONLINE    db00        
ora....SM1.asm application    0/5    0/0    OFFLINE   OFFLINE               
ora....00.lsnr application    0/5    0/0    ONLINE    ONLINE    db00        
ora.db00.gsd   application    0/5    0/0    OFFLINE   OFFLINE               
ora.db00.ons   application    0/3    0/0    ONLINE    ONLINE    db00        
ora.db00.vip   ora....t1.type 0/0    0/0    ONLINE    ONLINE    db00        
ora....SM2.asm application    0/5    0/0    OFFLINE   OFFLINE               
ora....01.lsnr application    0/5    0/0    ONLINE    ONLINE    db01        
ora.db01.gsd   application    0/5    0/0    OFFLINE   OFFLINE               
ora.db01.ons   application    0/3    0/0    ONLINE    ONLINE    db01        
ora.db01.vip   ora....t1.type 0/0    0/0    ONLINE    ONLINE    db01        
ora.gsd        ora.gsd.type   0/5    0/     OFFLINE   OFFLINE               
ora....network ora....rk.type 0/5    0/     ONLINE    ONLINE    db00        
ora.oc4j       ora.oc4j.type  0/1    0/2    ONLINE    ONLINE    db00        
ora.ons        ora.ons.type   0/3    0/     ONLINE    ONLINE    db00        
ora.scan1.vip  ora....ip.type 0/0    0/0    ONLINE    ONLINE    db00        
ora.test.db    ora....se.type 0/2    0/1    ONLINE    ONLINE    db00    

观察Oracle ASM相关的服务是停止的,因为没有用到ASM:

[root@db00 ~]# crsctl stat res -t -w "TYPE = ora.asm.type"
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS       
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.asm
               OFFLINE OFFLINE      db00                     Instance Shutdown   
               OFFLINE OFFLINE      db01                                      

查看Oracle RAC数据库实例运行情况:

[root@db00 ~]# crsctl stat res -t -w "TYPE = ora.database.type"
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS       
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------  
ora.test.db
      1        ONLINE  ONLINE       db00                     Open                
      2        ONLINE  ONLINE       db01                     Open  

5.3 Voting Disk

[root@db00 ~]# crsctl query css votedisk
##  STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
 1. ONLINE   20d031e97e3b4f68bfccdc722c5c8af3 (/mnt/dbfs/4actlq1dobrf/dbfs-AvCZfFP8QNWHBxl8vJkN6Q/voting_disk/test/voting_files_00) []
 2. ONLINE   14e4bfc1e4394f03bf7b80fc06a5f056 (/mnt/dbfs/4actlq1dobrf/dbfs-AvCZfFP8QNWHBxl8vJkN6Q/voting_disk/test/voting_files_01) []
 3. ONLINE   115afea998734fe3bf253de372c1718c (/mnt/dbfs/4actlq1dobrf/dbfs-AvCZfFP8QNWHBxl8vJkN6Q/voting_disk/test/voting_files_02) []
Located 3 voting disk(s).

5.4 OCR文件

[root@db00 ~]# ocrcheck
Status of Oracle Cluster Registry is as follows :
         Version                  :          3
         Total space (kbytes)     :     262120
         Used space (kbytes)      :       2148
         Available space (kbytes) :     259972
         ID                       : 1459761743
         Device/File Name         : /mnt/dbfs/4actlq1dobrf/dbfs-AvCZfFP8QNWHBxl8vJkN6Q/ocr/test/ocr_files_00
                                    Device/File integrity check succeeded
         Device/File Name         : /mnt/dbfs/4actlq1dobrf/dbfs-AvCZfFP8QNWHBxl8vJkN6Q/ocr/test/ocr_files_01
                                    Device/File integrity check succeeded
         Device/File Name         : /mnt/dbfs/4actlq1dobrf/dbfs-AvCZfFP8QNWHBxl8vJkN6Q/ocr/test/ocr_files_02
                                    Device/File integrity check succeeded

                                    Device/File not configured

                                    Device/File not configured

         Cluster registry integrity check succeeded

         Logical corruption check succeeded

5.5 数据库实例

[root@db00 ~]# crsctl status res -t -w "TYPE = ora.database.type"
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS       
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.test.db
      1        ONLINE  ONLINE       db00                     Open                
      2        ONLINE  ONLINE       db01                     Open    

登录其中一个数据库,观察到所有数据文件位于DBFS之上。

SQL> select file_name from dba_data_files;

FILE_NAME
--------------------------------------------------------------------------------
/mnt/dbfs/4actlq1dobrf/dbfs-AvCZfFP8QNWHBxl8vJkN6Q/oradata/test/users01.dbf
/mnt/dbfs/4actlq1dobrf/dbfs-AvCZfFP8QNWHBxl8vJkN6Q/oradata/test/undotbs01.dbf
/mnt/dbfs/4actlq1dobrf/dbfs-AvCZfFP8QNWHBxl8vJkN6Q/oradata/test/sysaux01.dbf
/mnt/dbfs/4actlq1dobrf/dbfs-AvCZfFP8QNWHBxl8vJkN6Q/oradata/test/system01.dbf
/mnt/dbfs/4actlq1dobrf/dbfs-AvCZfFP8QNWHBxl8vJkN6Q/oradata/test/undotbs02.dbf

6、数据库测试

6.1 环境准备

编辑“.bash_profile”,设置环境变量。其中“Oracle_HOME”可以根据自己的真实环境进行调整。本文档中为了讲解与测试方便,申请了一台ECS用于安装sysbench。

SYSBENCH_HOME=/opt/sysbench-0.5

export ORACLE_SID=orcl
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1

export CC=cc
export CXX=c++
export CFLAGS="-m64 -I/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/public"
export CXXFLAGS="$CFLAGS"

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib:/lib
export PATH=$PATH:$HOME/.local/bin:$HOME/bin:$ORACLE_HOME/bin:$SYSBENCH_HOME/sysbench

tns配置:

test1 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 172.19.143.106)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = test)
    )
  )


test2 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 172.19.143.107)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = test)
    )
  )

6.2 sysbench安装

下载sysbench-0.5版本,进行编译:

#下载sysbench
git clone https://github.com/akopytov/sysbench.git -b 0.5

#运行autogen.sh
./autogen.sh

#编译与安装
./configure --with-oracle
make ORA_LIBS=/u01/app/oracle/product/11.2.0/dbhome_1/lib/libclntsh.so
make install

登录Oracle RAC其中一个实例,创建sysbench用户:

#切换到Oracle用户,其“.bash_profile”配置如下
export ORACLE_SID=test1
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/product/11.2.0/oracle
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib:/lib
export PATH=$PATH:$HOME/.local/bin:$HOME/bin:$ORACLE_HOME/bin

#登录Oracle,创建sysbench用户
sqlplus / as sydsba
SQL> create user sysbench identified by sysbench;
SQL> grant connect,resource,create table to sysbench;

准备测试数据:

#准备数据
sysbench  --db-driver=oracle  --oracle-user=sysbench --oracle-password=sysbench \
--max-time=1000000 --report-interval=1  --oracle-db=test1 --num-threads=4 \
--max-requests=0 --oltp-tables-count=32 \
--test=/opt/sysbench-0.5/sysbench/tests/db/oltp.lua  prepare

6.3 sysbench测试

用sysbench验证Oracle RAC的第一个节点上的实例,即“--oracle-db=test1”:

#运行sysbench
sysbench  --db-driver=oracle  --oracle-user=sysbench --oracle-password=sysbench \
--max-time=1000000 --report-interval=1  --oracle-db=test1 --num-threads=4 \
--max-requests=0 --oltp-tables-count=32 \
--test=/opt/sysbench-0.5/sysbench/tests/db/oltp.lua  run


sysbench 0.5:  multi-threaded system evaluation benchmark

Running the test with following options:
Number of threads: 4
Report intermediate results every 1 second(s)
Random number generator seed is 0 and will be ignored


Initializing worker threads...

Threads started!

[   1s] threads: 4, tps: 149.99, reads: 2134.86, writes: 599.96, response time: 40.00ms (95%), errors: 0.00, reconnects:  0.00
[   2s] threads: 4, tps: 157.00, reads: 2209.01, writes: 634.00, response time: 32.58ms (95%), errors: 0.00, reconnects:  0.00
[   3s] threads: 4, tps: 170.00, reads: 2382.00, writes: 676.00, response time: 33.47ms (95%), errors: 0.00, reconnects:  0.00
[   4s] threads: 4, tps: 173.00, reads: 2424.00, writes: 690.00, response time: 30.27ms (95%), errors: 0.00, reconnects:  0.00
[   5s] threads: 4, tps: 171.00, reads: 2391.00, writes: 684.00, response time: 28.68ms (95%), errors: 0.00, reconnects:  0.00
[   6s] threads: 4, tps: 168.00, reads: 2347.00, writes: 676.00, response time: 29.99ms (95%), errors: 0.00, reconnects:  0.00
[   7s] threads: 4, tps: 168.00, reads: 2348.00, writes: 668.00, response time: 32.63ms (95%), errors: 0.00, reconnects:  0.00
[   8s] threads: 4, tps: 175.00, reads: 2447.00, writes: 703.00, response time: 28.34ms (95%), errors: 0.00, reconnects:  0.00
[   9s] threads: 4, tps: 170.00, reads: 2384.00, writes: 682.00, response time: 28.81ms (95%), errors: 0.00, reconnects:  0.00
[  10s] threads: 4, tps: 178.00, reads: 2476.00, writes: 707.00, response time: 28.30ms (95%), errors: 0.00, reconnects:  0.00
[  11s] threads: 4, tps: 175.00, reads: 2474.00, writes: 704.00, response time: 29.27ms (95%), errors: 0.00, reconnects:  0.00
[  12s] threads: 4, tps: 171.00, reads: 2391.00, writes: 683.00, response time: 28.74ms (95%), errors: 0.00, reconnects:  0.00
[  13s] threads: 4, tps: 173.00, reads: 2427.00, writes: 692.00, response time: 29.78ms (95%), errors: 0.00, reconnects:  0.00
[  14s] threads: 4, tps: 176.00, reads: 2452.00, writes: 701.00, response time: 30.10ms (95%), errors: 0.00, reconnects:  0.00
[  15s] threads: 4, tps: 179.00, reads: 2498.00, writes: 720.00, response time: 28.10ms (95%), errors: 0.00, reconnects:  0.00
[  16s] threads: 4, tps: 175.00, reads: 2463.00, writes: 700.00, response time: 28.89ms (95%), errors: 0.00, reconnects:  0.00
[  17s] threads: 4, tps: 178.00, reads: 2481.00, writes: 708.00, response time: 28.23ms (95%), errors: 0.00, reconnects:  0.00
[  18s] threads: 4, tps: 162.00, reads: 2276.00, writes: 648.00, response time: 35.17ms (95%), errors: 0.00, reconnects:  0.00
[  19s] threads: 4, tps: 173.00, reads: 2416.00, writes: 692.00, response time: 30.66ms (95%), errors: 0.00, reconnects:  0.00
[  20s] threads: 4, tps: 176.00, reads: 2467.00, writes: 704.00, response time: 28.97ms (95%), errors: 0.00, reconnects:  0.00
OLTP test statistics:
    queries performed:
        read:                            47908
        write:                           13688
        other:                           6844
        total:                           68440
    transactions:                        3422   (170.96 per sec.)
    read/write requests:                 61596  (3077.26 per sec.)
    other operations:                    6844   (341.92 per sec.)
    ignored errors:                      0      (0.00 per sec.)
    reconnects:                          0      (0.00 per sec.)

General statistics:
    total time:                          20.0165s
    total number of events:              3422
    total time taken by event execution: 80.0514s
    response time:
         min:                                 11.86ms
         avg:                                 23.39ms
         max:                                 70.88ms
         approx.  95 percentile:              30.41ms

Threads fairness:
    events (avg/stddev):           855.5000/2.50
    execution time (avg/stddev):   20.0129/0.00

用sysbench验证Oracle RAC的第二个节点上的实例,即“--oracle-db=test2”:

#运行sysbench
sysbench  --db-driver=oracle  --oracle-user=sysbench --oracle-password=sysbench \
--max-time=1000000 --report-interval=1  --oracle-db=test2 --num-threads=4 \
--max-requests=0 --oltp-tables-count=32 \
--test=/opt/sysbench-0.5/sysbench/tests/db/oltp.lua
sysbench 0.5:  multi-threaded system evaluation benchmark

Running the test with following options:
Number of threads: 4
Report intermediate results every 1 second(s)
Random number generator seed is 0 and will be ignored


Initializing worker threads...

Threads started!

[   1s] threads: 4, tps: 83.99, reads: 1210.92, writes: 339.98, response time: 87.24ms (95%), errors: 0.00, reconnects:  0.00
[   2s] threads: 4, tps: 149.00, reads: 2087.01, writes: 592.00, response time: 34.86ms (95%), errors: 0.00, reconnects:  0.00
[   3s] threads: 4, tps: 124.00, reads: 1729.00, writes: 499.00, response time: 40.96ms (95%), errors: 0.00, reconnects:  0.00
[   4s] threads: 4, tps: 146.00, reads: 2047.00, writes: 581.00, response time: 33.11ms (95%), errors: 0.00, reconnects:  0.00
[   5s] threads: 4, tps: 160.00, reads: 2244.00, writes: 640.00, response time: 30.86ms (95%), errors: 0.00, reconnects:  0.00
[   6s] threads: 4, tps: 163.00, reads: 2292.00, writes: 652.00, response time: 31.71ms (95%), errors: 0.00, reconnects:  0.00
[   7s] threads: 4, tps: 168.00, reads: 2354.00, writes: 672.00, response time: 29.26ms (95%), errors: 0.00, reconnects:  0.00
[   8s] threads: 4, tps: 165.00, reads: 2294.00, writes: 660.00, response time: 31.21ms (95%), errors: 0.00, reconnects:  0.00
[   9s] threads: 4, tps: 170.00, reads: 2399.00, writes: 684.00, response time: 29.35ms (95%), errors: 0.00, reconnects:  0.00
[  10s] threads: 4, tps: 166.00, reads: 2299.00, writes: 660.00, response time: 30.97ms (95%), errors: 0.00, reconnects:  0.00
[  11s] threads: 4, tps: 171.00, reads: 2416.00, writes: 684.00, response time: 29.40ms (95%), errors: 0.00, reconnects:  0.00
[  12s] threads: 4, tps: 176.00, reads: 2457.00, writes: 704.00, response time: 28.68ms (95%), errors: 0.00, reconnects:  0.00
[  13s] threads: 4, tps: 173.00, reads: 2420.00, writes: 692.00, response time: 29.66ms (95%), errors: 0.00, reconnects:  0.00
[  14s] threads: 4, tps: 178.00, reads: 2503.00, writes: 716.00, response time: 28.90ms (95%), errors: 0.00, reconnects:  0.00
[  15s] threads: 4, tps: 181.00, reads: 2524.00, writes: 720.00, response time: 28.64ms (95%), errors: 0.00, reconnects:  0.00
[  16s] threads: 4, tps: 178.00, reads: 2486.00, writes: 715.00, response time: 28.91ms (95%), errors: 0.00, reconnects:  0.00
[  17s] threads: 4, tps: 176.00, reads: 2460.01, writes: 701.00, response time: 31.09ms (95%), errors: 0.00, reconnects:  0.00
[  18s] threads: 4, tps: 174.00, reads: 2442.00, writes: 700.00, response time: 29.47ms (95%), errors: 0.00, reconnects:  0.00
[  19s] threads: 4, tps: 162.00, reads: 2274.00, writes: 649.00, response time: 35.09ms (95%), errors: 0.00, reconnects:  0.00
[  20s] threads: 4, tps: 184.00, reads: 2584.00, writes: 731.00, response time: 27.17ms (95%), errors: 0.00, reconnects:  0.00
OLTP test statistics:
    queries performed:
        read:                            45528
        write:                           13008
        other:                           6504
        total:                           65040
    transactions:                        3252   (162.52 per sec.)
    read/write requests:                 58536  (2925.40 per sec.)
    other operations:                    6504   (325.04 per sec.)
    ignored errors:                      0      (0.00 per sec.)
    reconnects:                          0      (0.00 per sec.)

General statistics:
    total time:                          20.0096s
    total number of events:              3252
    total time taken by event execution: 80.0321s
    response time:
         min:                                 11.01ms
         avg:                                 24.61ms
         max:                                108.54ms
         approx.  95 percentile:              33.12ms

Threads fairness:
    events (avg/stddev):           813.0000/4.30
    execution time (avg/stddev):   20.0080/0.00
阿里云首页 数据库文件存储 相关技术圈