重力眩晕2会免:AIX上如何配置异步IO

来源:百度文库 编辑:九乡新闻网 时间:2024/04/23 19:24:13

AIX的异步IO需要bos.rte.aio文件集的支持

#lslpp -l bos.rte.aio
  Fileset                      Level  State      Description         
  ----------------------------------------------------------------------------
Path: /usr/lib/objrepos
  bos.rte.aio               5.3.0.62  COMMITTED  Asynchronous I/O Extension

如何启用AIO

#mkdev -l aio0
aio0 Available

#chdev -P -l aio0 -a autoconfig='available'
aio0 changed

查看aio的配置信息

#lsattr -El aio0
autoconfig available STATE to be configured at system restart True
fastpath   enable    State of fast path                       True
kprocprio  39        Server PRIORITY                          True
maxreqs    4096      Maximum number of REQUESTS               True
maxservers 10        MAXIMUM number of servers per cpu        True
minservers 1         MINIMUM number of servers                True

其中,maxreqs表示同一时刻所允许的异步 I/O 请求,包括已经在处理的异步 I/O 请求和等待处理的异步 I/O 请求。maxservers和minservers参数指定了用于处理异步IO的进程数。默认的maxservers=10对于大多数系统来说,应该已经足够了,这两个参数都是针对文件系统等的aio的,而raw设备的异步IO直接由内核进程完成,不依赖aioserver。autoconfig必须设置为available才会在下次启动时自动激活AIO。

通过如下命令可以查询系统当前aioserver的个数,如果已经达到或者接近maxservers,则需要考虑增加该参数。

#pstat -a | grep aios | wc -l

从AIX5.2开始,支持两种模式的AIO,一种是传统模式的,一种是posix的

#pstat -a | grep aio
 40 a   28088      1  28088     0     0     1  posix_aioserver 
 67 a   43002      1  43002     0     0     1  aioserver

Oracle在AIX平台上安装的时候要求必须开启AIO,在rootpre.sh脚本中包含了启动AIO的代码

# Asynchronous I/O
echo "Configuring Asynchronous I/O..." | tee -a $LOG
    aio=`lsdev -C -t aio|awk '{print $2}'`
    case $aio in
      *Available*) echo "Asynchronous I/O is already defined" | tee -a $LOG
                   ;;
      *Defined*)   mkdev -l aio0 | tee -a $LOG
                   chdev -P -l aio0 -a autoconfig='available'
                   ;;
      *)   echo "Asynchronous I/O is not installed on this system." >> $LOG
           cat << END

Asynchronous I/O is not installed on this system.

You will need to install it, and either configure it yourself using
'smit aio' or rerun the Oracle root installation procedure.
END
                ;;
    esac

如何删除AIO

AIO是由内核提供支持的,首先将autoconfig改为defined然后重启系统

#chdev -P -l aio0 -a autoconfig='defined'

如果使用rmdev -dl aio0彻底删除了aio0的定义,则再次使用mkdev -l aio0的时候可能遭遇以下错误:

mkdev: 0514-519 The following device was not found in the customized
        device configuration database:
        name = 'aio0'

这时需要先定义设备,才能添加设备,定义aio0设备可以通过smit aio选择Configure Defined Asynchronous I/O。

另外要提到的一点,就是Oracle的存储测试工具Orion,也是必须打开AIO的,否则会报如下错误:

exec(): 0509-036 Cannot load program ./orion because of the following errors:
        0509-130 Symbol resolution failed for /usr/lib/libc.a[aio_64.o] because:
        0509-136   Symbol kaio_rdwr64 (number 0) is not exported from
                   dependent module /unix.
        0509-136   Symbol listio64 (number 1) is not exported from
                   dependent module /unix.
        0509-136   Symbol acancel64 (number 2) is not exported from
                   dependent module /unix.
        0509-136   Symbol iosuspend64 (number 3) is not exported from
                   dependent module /unix.
        0509-136   Symbol aio_nwait (number 4) is not exported from
                   dependent module /unix.
        0509-136   Symbol aio_nwait64 (number 5) is not exported from
                   dependent module /unix.
        0509-136   Symbol aio_nwait_timeout (number 6) is not exported from
                   dependent module /unix.
        0509-136   Symbol aio_nwait_timeout64 (number 7) is not exported from
                   dependent module /unix.
        0509-026 System error: Error 0
        0509-192 Examine .loader section symbols with the
                 'dump -Tv' command.