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

On Debian Wheezy, ulimit -a gives:

open files                      (-n) 1024

I add this to /etc/security/limits.conf

*                hard    nofile          64000

then reboot.

And ulimit -a still gives a maximum number of open files of 1024. Anyone could throw some light on it?

share|improve this question
    
is this possibly a virtual host? –  Dennis Nolte Jul 4 at 9:49
    
no, it it's a mongodb server –  Icu Jul 4 at 11:24

1 Answer 1

up vote 2 down vote accepted

Option one: You did not set the softlimit higher aswell.

Possible solution:

in /etc/security/limits.conf add

* soft nofile 2048

test with

ulimit -n 2048 

Option two: You are logged in as user and in some "config" file (profile, bashrc, something like this) the soft limit is set to a lower value.

Possible solution f.e. grep for ulimit in your etc folder and/or home folder.

Warning: Depending on the amount of files/directorys you have in there you might want to consider only specific directorys/files

ps: there are a lot of similiar question here you might want to read up.

Specially Hard vs Soft Limit

Read here for possible other solution which go more into detail Too Many Open Files

share|improve this answer
    
Actually, I was trying to set only the hard limit to 64000. So the soft limit was still on 1024. Now I tried to set a soft limit to 64000 + hard = 72000. But it didn't work. I tried also "* - nofile 64000" and I get the same result. –  Icu Jul 4 at 9:39
    
After having read "Too Many Open Files", I thought a kernel setting would be overriding the limits.conf settings but: "fs.file-max = 4933738" –  Icu Jul 4 at 9:46
    
@Icu try the answers from this one aswell: serverfault.com/questions/93234/… might be related to your shell –  Dennis Nolte Jul 4 at 9:54
    
I added 'session required pam_limits.so' to /etc/pam.d/other and common-session but it doesn't help ... As an alternative, I added a 'ulimit -n' to my init script and it works but I wonder why I can't get the correct values in my shell. –  Icu Jul 4 at 11:11

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.