问题描述
Weblogic应用启动后,在某个节点,root用户切换到weblogic用户报如下错误:
bash: fork: Resource temporarily unavailable
问题分析:
从错误的字面意思可以看到临时资源不足
查看内存充足
查看用户进程
ps -ef | wc –l
ps ux | wc -l
ulimit -u
查看用户限制
su – weblogic(报错,无需理会等会儿)
ulimit –a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 1031953
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes(-u) 1024
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
解决方法
修改操作系统的资源配置:
su – root
vi /etc/security/limits.conf
增加如下内容
weblogic soft nproc 2047
weblogic hard nproc 16384
weblogic soft nofile 1024
weblogic hard nofile 65536
su – weblogic(此时应该不会报错了)
ulimit –a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 1031953
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes(-u) 2047
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited