lundi 8 décembre 2014

Why won't the number of open file descriptors change when I set them in CentOS 6.3?


uname -a:


Linux lab.testing.com 2.6.18-164.el5 #1 SMP Thu Sep 3 03:33:56 EDT 2009 i686 i686 i386 GNU/Linux


ulimit -Hn: 1024


ulimit -Sn: 1024


ulimit -n: 1024


I opened /etc/sysctl.conf in vi and added this at the bottom:


fs.file-max = 65536


I opened /etc/security/limits.conf in vi and added this at the bottom:




  • (<- that is a star, not a dot) soft open files 8192




  • (<- that is a star, not a dot) hard open files 10240




testuser soft open files 8192


testuser hard open files 10240


Whether I login as root or as testuser, and whether I reboot or cold-boot the box, I still get:


ulimit -Hn: 1024


ulimit -Sn: 1024


ulimit -n: 1024


I can set the open file descriptors to 10240 at the command line but that only sets it for the session and then it's lost when I logout/login and/or reboot/cold-boot:


[root@lab ~]# ulimit -n 10240


[root@lab ~]# ulimit -Hn


10240


[root@lab ~]# ulimit -Sn


10240


[root@lab ~]# ulimit -n


10240


What am I missing?


And in case someone wants to see it:


[root@itnm ~]# ulimit -a (before I set it at the command line):


core file size (blocks, -c) 0


data seg size (kbytes, -d) unlimited


scheduling priority (-e) 0


file size (blocks, -f) unlimited


pending signals (-i) 46464


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) 46464


virtual memory (kbytes, -v) unlimited


file locks (-x) unlimited



Aucun commentaire:

Enregistrer un commentaire