AIX的异步IO设置

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。

posted on 2009-05-13 01:16  .net学习交流  阅读(3248)  评论(0编辑  收藏  举报

导航