Showing posts with label ulimit. Show all posts
Showing posts with label ulimit. Show all posts

Increasing nofiles pam ulimit

cat /proc/{process_id}/limits:

$ cat /proc/1882/limits
Limit                     Soft Limit           Hard Limit           Units
Max cpu time              unlimited            unlimited            seconds
Max file size             unlimited            unlimited            bytes
Max open files            4096                 4096                 files
Max locked memory         65536                65536                bytes

it looks like 4096 number is too low for elastic search , now checking if the limit is reached for this PID
 /proc/{process_id}/fd is a directory that holds a file for each open file the process has,
 ls /proc/1882/fd | wc -l


/etc/pam.d/common-session needs to have this line in it:
session required pam_limits.so

/etc/pam.d/common-session-noninteractive also needs to have this line in it:
session required pam_limits.so

How to find ulimit for www-data user ?


# su www-data --shell /bin/bash --command "ulimit -aH" 
#  ulimit -aS ->will give soft limit

core file size          (blocks, -c) unlimited
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 3900
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1048576
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) unlimited
cpu time               (seconds, -t) unlimited
max user processes              (-u) 3900
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited