# Elastic search not detecting file descriptors limit

**URL:** <https://discuss.elastic.co/t/elastic-search-not-detecting-file-descriptors-limit/7219>\
**Category:** Elasticsearch\
**Created:** [April 4, 2012, 3:41am UTC](https://discuss.elastic.co/t/elastic-search-not-detecting-file-descriptors-limit/7219 "2012-04-04T03:41:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![William\_Jimenez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/william_jimenez/32/2934_2.png) [@William\_Jimenez](https://discuss.elastic.co/u/William_Jimenez)\
**Post date:** [April 4, 2012, 3:41am UTC](https://discuss.elastic.co/t/elastic-search-not-detecting-file-descriptors-limit/7219/1 "2012-04-04T03:41:13Z")

</div>

Hi  
I have set my file descriptors limit to 400000 on my Ubuntu 10.04 LTS  
machine, but elastic search doesn't seem to detect it.

wjimenez@[myhost]\> sysctl -a |grep fs.file-max  
error: permission denied on key 'kernel.cad\_pid'  
error: permission denied on key 'fs.binfmt\_misc.register'  
error: permission denied on key 'dev.parport.parport0.autoprobe'  
error: permission denied on key 'dev.parport.parport0.autoprobe0'  
error: permission denied on key 'dev.parport.parport0.autoprobe1'  
error: permission denied on key 'dev.parport.parport0.autoprobe2'  
error: permission denied on key 'dev.parport.parport0.autoprobe3'  
fs.file-max = 400000  
error: permission denied on key 'net.ipv4.route.flush'

wjimenez@[myhost]\> bin/elasticsearch -f -Des.max-open-files=true  
[2012-04-03 20:40:28,116][INFO][bootstrap] max\_open\_files  
[999]  
Anything I am missing here?

---

<div class="post-metadata">

**Author:** ![Radu\_Gheorghe1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/radu_gheorghe1/32/2688_2.png) [@Radu\_Gheorghe1](https://discuss.elastic.co/u/Radu_Gheorghe1)\
**Post date:** [April 4, 2012, 7:37am UTC](https://discuss.elastic.co/t/elastic-search-not-detecting-file-descriptors-limit/7219/2 "2012-04-04T07:37:45Z")

</div>

Hi William,

AFAIK, these limits are per-user. So if you have 400000 for root and  
start ES as wjimenez, then the behavior you're describing is normal.

We are setting those limits in the init script, before starting ES.  
Another option is to edit /etc/security/limits.conf and set the limits  
for the user ES runs with.

And of course, from the console, you can always do `ulimit -n 400000`  
before starting ES manually.

On Apr 4, 6:41 am, William Jimenez [wjimenez5...@gmail.com](mailto:wjimenez5...@gmail.com) wrote:

> Hi  
> I have set my file descriptors limit to 400000 on my Ubuntu 10.04 LTS  
> machine, but Elasticsearch doesn't seem to detect it.
> 
> wjimenez@[myhost]\> sysctl -a |grep fs.file-max  
> error: permission denied on key 'kernel.cad\_pid'  
> error: permission denied on key 'fs.binfmt\_misc.register'  
> error: permission denied on key 'dev.parport.parport0.autoprobe'  
> error: permission denied on key 'dev.parport.parport0.autoprobe0'  
> error: permission denied on key 'dev.parport.parport0.autoprobe1'  
> error: permission denied on key 'dev.parport.parport0.autoprobe2'  
> error: permission denied on key 'dev.parport.parport0.autoprobe3'  
> fs.file-max = 400000  
> error: permission denied on key 'net.ipv4.route.flush'
> 
> wjimenez@[myhost]\> bin/elasticsearch -f -Des.max-open-files=true  
> [2012-04-03 20:40:28,116][INFO][bootstrap] max\_open\_files  
> [999]  
> Anything I am missing here?

---

<div class="post-metadata">

**Author:** ![William\_Jimenez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/william_jimenez/32/2934_2.png) [@William\_Jimenez](https://discuss.elastic.co/u/William_Jimenez)\
**Post date:** [April 4, 2012, 5:58pm UTC](https://discuss.elastic.co/t/elastic-search-not-detecting-file-descriptors-limit/7219/3 "2012-04-04T17:58:51Z")

</div>

Hi Radu  
Thanks so much for that explanation. so if I use sudo to run  
elasticsearch, would I expect to it to pick up that ulmit setting? Also the  
ulmit command doesn't work for me (maybe b/c I am on Ubuntu)?

wjimenez@[myhost]\> sudo bin/elasticsearch -f -Des.max-open-files=true  
[sudo] password for wjimenez:  
[2012-04-04 10:55:22,144][INFO][bootstrap] max\_open\_files  
[999]  
[2012-04-04 10:55:23,870][INFO][node] [Bast]  
{0.18.7}[5817]: initializing ...  
[2012-04-04 10:55:23,891][INFO][plugins] [Bast] loaded  
, sites   
wjimenez@[myhost]\> sudo ulimit -n 400000  
sudo: ulimit: command not found

Thanks

On Wednesday, April 4, 2012 12:37:45 AM UTC-7, Radu Gheorghe wrote:

> Hi William,
> 
> AFAIK, these limits are per-user. So if you have 400000 for root and  
> start ES as wjimenez, then the behavior you're describing is normal.
> 
> We are setting those limits in the init script, before starting ES.  
> Another option is to edit /etc/security/limits.conf and set the limits  
> for the user ES runs with.
> 
> And of course, from the console, you can always do `ulimit -n 400000`  
> before starting ES manually.
> 
> On Apr 4, 6:41 am, William Jimenez [wjimenez5...@gmail.com](mailto:wjimenez5...@gmail.com) wrote:
> 
> > Hi  
> > I have set my file descriptors limit to 400000 on my Ubuntu 10.04 LTS  
> > machine, but Elasticsearch doesn't seem to detect it.
> > 
> > wjimenez@[myhost]\> sysctl -a |grep fs.file-max  
> > error: permission denied on key 'kernel.cad\_pid'  
> > error: permission denied on key 'fs.binfmt\_misc.register'  
> > error: permission denied on key 'dev.parport.parport0.autoprobe'  
> > error: permission denied on key 'dev.parport.parport0.autoprobe0'  
> > error: permission denied on key 'dev.parport.parport0.autoprobe1'  
> > error: permission denied on key 'dev.parport.parport0.autoprobe2'  
> > error: permission denied on key 'dev.parport.parport0.autoprobe3'  
> > fs.file-max = 400000  
> > error: permission denied on key 'net.ipv4.route.flush'
> > 
> > wjimenez@[myhost]\> bin/elasticsearch -f -Des.max-open-files=true  
> > [2012-04-03 20:40:28,116][INFO][bootstrap]  
> > max\_open\_files  
> > [999]  
> > Anything I am missing here?

---

<div class="post-metadata">

**Author:** ![Radu\_Gheorghe1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/radu_gheorghe1/32/2688_2.png) [@Radu\_Gheorghe1](https://discuss.elastic.co/u/Radu_Gheorghe1)\
**Post date:** [April 5, 2012, 5:59am UTC](https://discuss.elastic.co/t/elastic-search-not-detecting-file-descriptors-limit/7219/4 "2012-04-05T05:59:17Z")

</div>

Hi William,

If you want to do the thing as root, I think you have to go this path:

$ sudo su

# ulimit -n 400000

# bin/elasticsearch -f -Des.max-open-files=true

Apparently, you can't set the limit for another user using sudo, even  
if you're root:  
root# sudo -u radu ulimit -n 400000  
sudo: ulimit: command not found

On Apr 4, 8:58 pm, William Jimenez [wjimenez5...@gmail.com](mailto:wjimenez5...@gmail.com) wrote:

> Hi Radu  
> Thanks so much for that explanation. so if I use sudo to run  
> elasticsearch, would I expect to it to pick up that ulmit setting? Also the  
> ulmit command doesn't work for me (maybe b/c I am on Ubuntu)?
> 
> wjimenez@[myhost]\> sudo bin/elasticsearch -f -Des.max-open-files=true  
> [sudo] password for wjimenez:  
> [2012-04-04 10:55:22,144][INFO][bootstrap] max\_open\_files  
> [999]  
> [2012-04-04 10:55:23,870][INFO][node] [Bast]  
> {0.18.7}[5817]: initializing ...  
> [2012-04-04 10:55:23,891][INFO][plugins] [Bast] loaded  
> , sites   
> wjimenez@[myhost]\> sudo ulimit -n 400000  
> sudo: ulimit: command not found
> 
> Thanks
> 
> On Wednesday, April 4, 2012 12:37:45 AM UTC-7, Radu Gheorghe wrote:
> 
> > Hi William,
> 
> > AFAIK, these limits are per-user. So if you have 400000 for root and  
> > start ES as wjimenez, then the behavior you're describing is normal.
> 
> > We are setting those limits in the init script, before starting ES.  
> > Another option is to edit /etc/security/limits.conf and set the limits  
> > for the user ES runs with.
> 
> > And of course, from the console, you can always do `ulimit -n 400000`  
> > before starting ES manually.
> 
> > On Apr 4, 6:41 am, William Jimenez [wjimenez5...@gmail.com](mailto:wjimenez5...@gmail.com) wrote:
> > 
> > > Hi  
> > > I have set my file descriptors limit to 400000 on my Ubuntu 10.04 LTS  
> > > machine, but Elasticsearch doesn't seem to detect it.
> 
> > > wjimenez@[myhost]\> sysctl -a |grep fs.file-max  
> > > error: permission denied on key 'kernel.cad\_pid'  
> > > error: permission denied on key 'fs.binfmt\_misc.register'  
> > > error: permission denied on key 'dev.parport.parport0.autoprobe'  
> > > error: permission denied on key 'dev.parport.parport0.autoprobe0'  
> > > error: permission denied on key 'dev.parport.parport0.autoprobe1'  
> > > error: permission denied on key 'dev.parport.parport0.autoprobe2'  
> > > error: permission denied on key 'dev.parport.parport0.autoprobe3'  
> > > fs.file-max = 400000  
> > > error: permission denied on key 'net.ipv4.route.flush'
> 
> > > wjimenez@[myhost]\> bin/elasticsearch -f -Des.max-open-files=true  
> > > [2012-04-03 20:40:28,116][INFO][bootstrap]  
> > > max\_open\_files  
> > > [999]  
> > > Anything I am missing here?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 3:33am UTC](https://discuss.elastic.co/t/elastic-search-not-detecting-file-descriptors-limit/7219/5 "2017-07-06T03:33:30Z")

</div>


