"(Too many open files)"
When I ran an lsof | wc -l it was almost at 1247
however as you can see from the below command , the limit for number of open files was set to 1024
# 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) 139264
max locked memory (kbytes, -l) 32
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) 139264
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
To resolve this, and to increase the number of open files that are allowed in the system, I did the below..
edit the /etc/security/limits.conf and add the following.
* soft nofile 4096
* hard nofile 4096
This means that for every user ( indicated by *) , the maximumm number of open files would be 4096. Instead of specifying *, you can specify the user-name .
You will have to restart the service, and exit the session for the new ulimit values to be in place.
# 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) 139264
max locked memory (kbytes, -l) 32
max memory size (kbytes, -m) unlimited
open files (-n) 4096
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) 139264
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
A FEW commands that I had run to understand the various system parameters. Putting it down here for future reference
lsof -p
cat /proc/sys/fs/file-max
sysctl -a
/etc/sysctl.conf
sysctl -p
No comments:
Post a Comment