Oracle9i AIX上单进程占用内存过多问题
作者:Piner
这个问题最早应当是gototop发现的,那已经是很多年以前的事情了,不过,一直到现在,这个问题其实没有最终解决,所以,这个补丁还是不得不一直打下去。bug描述:# Bugs resolved by this patch in conjunction with APAR IY49415:
# -------------------------------------------------------------
# 3028673: ORACLE ON AIX DOES NOT SHARE MANY CONST STRUCTS - PER
# PROCESS MEMORY OVERHEAD
更详细的信息可以参考metalink Note:259983.1,其实在早先的aix 4.3以及5.1上,当时的解决方案是:
$AIXTHREAD_SCOPE=S; export AIXTHREAD_SCOPE
$NUM_SPAREVP=1; export NUM_SPAREVP
但是,从aix 5.2开始,以上解决方案不再有效,所以,为了解决这个问题,aix 5.2推出了一个APAR IY49415,在aix 5.3中是查不到这个APAR信息的,但是不表示aix 5.3不支持,而是因为aix 5.3已经完全包含进去了。
AIX 5.2#instfix -a -ivk IY49415IY49415 Abstract: read-only reloc linking/loading support
IY49415 Symptom Text:
Programs having large amounts of read-only address constants
(compared to our competitors binaries of the same programs),
consume excessive amounts of memory under AIX since it has no
support to place address constants in read-only memory (text).
----------------------------
Fileset bos.64bit:5.2.0.12 is applied on the system.
Fileset bos.mp:5.2.0.18 is applied on the system.
Fileset bos.mp64:5.2.0.18 is applied on the system.
Fileset bos.rte.bind_cmds:5.2.0.13 is applied on the system.
Fileset bos.up:5.2.0.18 is applied on the system.
All filesets for IY49415 were found.
在有该APAR的aix 5.2系统上,或者所有的aix 5.3系统上,oracle推出了一个patch 3028673。打这个patch的方法也很奇怪,不是传统的Opatch方式去打,而是重新relink一个新的Oracle可执行文件,最终目的是通过直接修改源文件,使得oracle的多个进程之间可以共享一部分原来不能共享的资源,这部分资源大致占用1M多的空间。所以,该patch可以使得每个oracle进程降低1M多一点的内存使用,如果在进程特别多,而内存又比较紧张的系统上,这个patch还是非常有效果的。relink的方法为:Relink the oracle binary
~~~~~~~~~~~~~~~~~~~~~~~~
1 save your current version of $ORACLE_HOME/oracle
2 create a working directory $ORACLE_HOME/relink
3 cd to $ORACLE_HOME/relink
4 unzip the relinking package
5 link $ORACLE_HOME/bin/oracle to ./oracle0
6 run the script ./genscript to generate some required files and scripts
7 run ./relink.sh to generate the new oracle binary oracle0.new.$$
8 copy oracle0.new.$$ to $ORACLE_HOME/bin/oracle and verify that the
permissions match the original oracle binary.
另外,需要特别注意的是,patch中描述为# Patch Special Instructions
# ---------------------------
# This patch is for AIX 5.2 systems only.
#
# It is valid for all 920* AIX 5.2 systems.
这个是因为当时还没有aix 5.3系统,其实,实际上所有oracle 920系统+aix 5.2/5.3都可以使用这个patch,以下是使用前后的对照表,注意SIZE列,补丁前与补丁后基本相差1M多,如果有1000个进程,就可以节约1-2G的内存使用。补丁前$ps gx|grep oracle
PID TTY STAT TIME PGIN SIZE RSS LIM TSIZ TRS %CPU %MEM COMMAND
483436 - A 199:48 12 4804 25876 xx 49801 21136 0.5 0.0 oracletb
602170 - A 198:55 0 4804 25940 xx 49801 21136 0.5 0.0 oracletb
610420 - A 209:55 6 4844 25980 xx 49801 21136 0.5 0.0 oracletb
630988 - A 145:18 9 4860 25932 xx 49801 21136 0.4 0.0 oracletb
639154 - A 199:59 10 4828 25900 xx 49801 21136 0.5 0.0 oracletb
643276 - A 191:42 4 4792 25864 xx 49801 21136 0.5 0.0 oracletb
651494 - A 193:13 6 4844 25916 xx 49801 21136 0.5 0.0 oracletb
671756 - A 204:38 10 4776 25848 xx 49801 21136 0.5 0.0 oracletb
......
补丁后$ps gv|grep oracle
PID TTY STAT TIME PGIN SIZE RSS LIM TSIZ TRS %CPU %MEM COMMAND
639170 - A 0:01 3 3036 77100 xx 50917 74064 0.1 0.0 oracletb
643300 - A 0:00 0 3012 77076 xx 50917 74064 0.0 0.0 oracletb
651514 - A 0:03 1 3196 77196 xx 50917 74064 0.1 0.0 oracletb
671762 - A 0:05 2 3120 77184 xx 50917 74064 0.2 0.0 oracletb
675850 - A 0:04 0 3120 77120 xx 50917 74064 0.2 0.0 oracletb
680040 - A 0:06 0 3120 77184 xx 50917 74064 0.2 0.0 oracletb
688218 - A 0:05 0 3116 77180 xx 50917 74064 0.2 0.0 oracletb
700614 - A 0:09 2 3120 77120 xx 50917 74064 0.2 0.0 oracletb
......
By eygle on 2007-07-20 11:23 |
Comments (0) |
Oracle摘 | 1508 |