ºìÁªLinuxÃÅ»§
Linux°ïÖú

open too many files½â¾ö°ì·¨

·¢²¼Ê±¼ä:2008-03-04 16:00:37À´Ô´:ºìÁª×÷Õß:Gifotce
×î½üÔÚ×öÒ»¸öÏîÄ¿£¬Í¨¹ýWebLogic Javaµ÷ÓÃLinuxϵÄshell£¬·¢ÏÖºǫ́¾­³£³öÏÖopen too many filesµÄ±¨´íÈÕÖ¾£¬½â¾ö·½·¨ÈçÏ£º

£¨1£©LinuxÄں˶ÔÒ»¸öÎļþ±»´ò¿ªÊýÓÐÏÞÖÆ£¬ËùÒÔÎÒÃÇÐèÒªÐÞ¸ÄÒ»¸öϵͳÅäÖÃÎļþ£»

A¡¢¸Ä½øÓû§µÄÓÐ¹Ø nofile(¿É´ò¿ªµÄÎļþÃèÊö·ûµÄ×î´óÊý)ºÍnproc(µ¥¸öÓû§¿ÉÓõÄ×î´ó½ø³ÌÊýÁ¿)

# vi /etc/security/limits.conf

# Ìí¼ÓÈçϵÄÐÐ

ÒýÓÃ:
* soft nproc 2047

* hard nproc 16384

* soft nofile 1024

* hard nofile 65536


B¡¢ÒªÊ¹ limits.conf ÎļþÅäÖÃÉúЧ£¬±ØÐëҪȷ±£ pam_limits.so Îļþ±»¼ÓÈëµ½Æô¶¯ÎļþÖС£

²é¿´ /etc/pam.d/login ÎļþÖÐÓУº

session required /lib/security/pam_limits.so

£¨2£©WebLogic Java½ø³Ì¶Ô´ò¿ªÎļþÊýÒ²ÓÐÏÞÖÆ£¬½ö½öϵͳ»¹²»¹»£¬»¹ÒªÐÞ¸ÄWeblogicµÄ³õʼ»¯²ÎÊý½Å±¾./weblogic92/common/bin/commEnv.sh¡£ÈçÏ£º

ÒýÓÃ:
maxfiles=`ulimit -H -n`
if [ "$?" = "0" -a `expr ${maxfiles} : '[0-9][0-9]*$'` -eq 0 ]; then
ulimit -n 1024 (·Å´óËüµ½32768)
fi


¾­¹ýÉÏÊöÁ½¸ö²ÎÊýµÄÐ޸ģ¬ÖØÆôWebLogicÓ¦Óü°Linux»úÆ÷£¬ÏµÍ³Ã»ÓÐÔÙ±¨open too many filesµÄ´íÎóÁË¡£
ÎÄÕÂÆÀÂÛ

¹²ÓÐ 0 ÌõÆÀÂÛ