Linux下啓用異步IO

 

#是否已經安裝了AIO包
#rpm -qa|grep aio
libaio-0.3.107-10.el6.x86_64
libaio-devel-0.3.107-10.el6.x86_64
libsane-hpaio-3.12.4-4.el6_4.1.x86_64


#數據庫在鏈接時是否已經加載了aio的包
$/usr/bin/ldd $ORACLE_HOME/bin/oracle | grep libaio
        libaio.so.1 => /lib64/libaio.so.1 (0x00000032e6800000)
如果沒有看到libaio的包,說明Oracle沒有鏈接aio,那麼這時就需要重新make oracle的可執行文件,10g以後的方法爲
make PL_ORALIBS=-laio -f ins_rdbms.mk async_on


#數據庫的初始化參數開啓了異步IO
SQL> show parameter disk_asynch_io
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
disk_asynch_io                       boolean     TRUE

SQL> show parameter filesystemio_options
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
filesystemio_options                 string      SETALL

filesystemio_options有4個選項
ASYNCH enable asynchronous I/O on file system files, which has no timing requirement for transmission.
DIRECTIO: enable direct I/O on file system files, which bypasses the buffer cache.
SETALL: enable both asynchronous and direct I/O on file system files.
NONE: disable both asynchronous and direct I/O on file system files.
 

#修改內核參數文件/etc/sysctl.conf
fs.aio-max-nr = 1048576


#確認異步IO特性已經使用
#cat /proc/slabinfo | grep kio 
kioctx              8338   8380    384   10    1 : tunables   54   27    8 : slabdata    838    838      1
kiocb               1377   1665    256   15    1 : tunables  120   60    8 : slabdata    111    111    344
kiocb的第二、三列都不爲0,表示ORACLE的異步IO特性已經使用。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章