首先声明环境
使用的用户及其操作都是通过远程登录,即名为sshd的程序
最近,生产服务器的Java程序总是向Too many open files报告
已发现启动程序的用户的weblogic ulimit设置无效,运行ulimit -n时也会显示1024。
但是,系统配置文件设置为10240,而您自己的配置文件. bash_profile下也设置为10240
因此,尝试重新运行source ./.bash_profile
竟然报告错误!
[ WebLogic @ bogon~] $ source.//. bash _ profile
- bash :旗舰版:开放式文件: cannotmodifylimit :操作性
因为ulimits.conf文件用于PAM模块,所以我们查找了有关PAM模块的所有信息,并找到了问题的原因。
由于用户是远程登录的,因此在sshd配置文件中的设置下添加了注释
[ root @ bogon~] # grep-nuse PAM/etc/ssh/sshd _ config
108: # warning :‘usepa MnO’isnotsupportedinredhatenterpriselinuxandmaycauseseveral
111: # usepam是
1 .解决方案是删除此行的注释并重新启动sshd服务
重新登录weblogic用户,执行ulimit -n身份验证,然后重新启动并启用APP应用程序。
3 .最后使用以下脚本继续验证
forPIDin$(PS-aux|grep程序名称| grep-v grep|awk ({打印$2} ) ) )
do
cat/proc/$ { PID }/limits|grep‘max open files‘
唐