Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have installed elasticsearch @ debian6 by this tutorial. I have set up my system max open files directives so i have these values:

# su
# cat /proc/sys/fs/file-max

# ulimit -Hn

# ulimit -Sn

When i check elasticsearch max_file_descriptors by:

curl -XGET 'http://localhost:9200/_nodes?process=true&pretty=true'

i'll get 1024.

When i restart it by root user, it has "max_file_descriptors" : 64000 now.

Whats wrong with that init.d autostart? When i check htop, elastic autostarted by init.d with that 1024 descriptors is runnig under root user too.

I have set max files open by 2 confs:

cat /etc/sysctl.conf
fs.file-max = 70000

cat /etc/security/limits.conf
*   soft    nofile  32000
*   hard    nofile  64000

root    soft    nofile  32000
root    hard    nofile  64000
share|improve this question
How did you increase the open file limit? – mgorven Nov 2 '12 at 0:03
I updated my question by these informations – palmic Nov 2 '12 at 8:00
up vote 6 down vote accepted

The settings in /etc/security/limits.conf usually get applied by the pam_limits PAM module. Services started by init don't run under a PAM session however, and so these settings are not applied. The only reliable way I've found to set this is to run ulimit from the initscript itself. Edit the ElasticSearch initscript and add something like this near the top:

ulimit -n 64000

I'm not sure that you want to set sys.file-max BTW; on my system it defaults to 779149, and so you may be decreasing it by an order of magnitude.

share|improve this answer
Wonderful reply - Thank you for your time! – palmic Nov 3 '12 at 8:32

Your Answer


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.