Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Manually I can set via ulimit -n 20000 the file descriptor limit and it works fine. To have this limit for every user also after a restart of the machine, can I add

*                soft    nofile          20000

to /etc/security/limits.conf?

I can't try because I can't really restart the server.

share|improve this question

2 Answers 2

up vote 1 down vote accepted

Yes. This is one of the correct ways. Another way is setting fs.file-max in /etc/sysctl.conf.

But wait, no need to restart your server to checking, run ulimit -n 20001 from the command line, logout and login back, then re-run ulimit -n to see what happens.

share|improve this answer
    
OK, that's weird. I set via ulimit -n 20000 and then it has been set. If i logout and login again it returns me 1024. the old value. –  High6 Aug 31 '12 at 8:56
    
Obviously. Because it only affects your session. The default value is still 1024. –  quanta Aug 31 '12 at 9:08
1  
OK, thanks. I found this here. Seems to say the same, that the 1024 is hard-coded in the kernel. superuser.com/a/325323/87348 –  High6 Aug 31 '12 at 9:22

I think it is best way. Looks good for me

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.