# Max\_file\_descriptors - Value differs in log file and through API

**URL:** <https://discuss.elastic.co/t/max-file-descriptors-value-differs-in-log-file-and-through-api/14946>\
**Category:** Elasticsearch\
**Created:** [December 19, 2013, 9:34am UTC](https://discuss.elastic.co/t/max-file-descriptors-value-differs-in-log-file-and-through-api/14946 "2013-12-19T09:34:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![havetobe\_unknown](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/havetobe_unknown/32/4489_2.png) [@havetobe\_unknown](https://discuss.elastic.co/u/havetobe_unknown)\
**Post date:** [December 19, 2013, 9:34am UTC](https://discuss.elastic.co/t/max-file-descriptors-value-differs-in-log-file-and-through-api/14946/1 "2013-12-19T09:34:31Z")

</div>

Hello,

When I change the value for "max\_file\_descriptors" - say to 130000 for  
example - using the MAX\_OPEN\_FILES variable in init script, I noticed a  
strange behavior. The value dispalyed through API seems correct as shown  
below (ES version is 0.90.5) :

curl -XGET '[http://localhost:9200/\_nodes/\_local?process=true&pretty=true](http://localhost:9200/_nodes/_local?process=true&pretty=true)'

{  
"ok" : true,  
"cluster\_name" : "es-clust",  
"nodes" : {  
"5PHUSFl2TmW-3yCdisBWZg" : {  
"name" : "es-01",  
"transport\_address" : "inet[/10.0.8.107:9300]",  
"hostname" : "es-01",  
"version" : "0.90.5",  
"http\_address" : "inet[/10.0.8.107:9200]",  
"attributes" : {  
"master" : "true"  
},  
"process" : {  
"refresh\_interval" : 1000,  
"id" : 2633,  
_"max\_file\_descriptors" : 200000_  
}  
}  
}  
}

At the same time, I set the _-Des.max-open-files=true_ JVM option to have  
the value written in ES log file. This doesn't return the same value :

_[2013-12-19 10:14:28,614][INFO][bootstrap] max\_open\_files  
[97518]_  
[2013-12-19 10:14:28,727][INFO][node] [es-01]  
version[0.90.5], pid[2633], build[c8714e8/2013-09-17T12:50:20Z]  
[2013-12-19 10:14:28,733][INFO][node] [es-01]  
initializing ...  
[2013-12-19 10:14:28,742][INFO][plugins] [es-01] loaded  
[], sites [HQ, head]  
[2013-12-19 10:14:31,431][INFO][node] [es-01]  
initialized  
[2013-12-19 10:14:31,431][INFO][node] [es-01]  
starting ...  
[2013-12-19 10:14:31,528][INFO][transport] [es-01]  
bound\_address {inet[/10.0.8.107:9300]}, publish\_address  
{inet[/10.0.8.107:9300]}  
[2013-12-19 10:14:36,095][INFO][cluster.service] [es-01]  
new\_master  
[es-01][5PHUSFl2TmW-3yCdisBWZg][inet[/10.0.8.107:9300]]{master=true},  
reason: zen-disco-join (elected\_as\_master)  
[2013-12-19 10:14:36,127][INFO][discovery] [es-01]  
es-ket/5PHUSFl2TmW-3yCdisBWZg  
[2013-12-19 10:14:36,131][INFO][http] [es-01]  
bound\_address {inet[/10.0.8.107:9200]}, publish\_address  
{inet[/10.0.8.107:9200]}  
[2013-12-19 10:14:36,132][INFO][node] [es-01] started

I found that the value displayed in log file never gets higher than _97518_.  
If I set a value under this apparent "limit" - say 75000 for instance - the  
result seems (nearly) correct in log file (as well as through the API) :

_[2013-12-19 10:28:38,002][INFO][bootstrap] max\_open\_files  
[74975]_  
[2013-12-19 10:28:38,128][INFO][node] [es-01]  
version[0.90.5], pid[2835], build[c8714e8/2013-09-17T12:50:20Z]  
[2013-12-19 10:28:38,128][INFO][node] [es-01]  
initializing ...  
[2013-12-19 10:28:38,137][INFO][plugins] [es-01] loaded  
[], sites [HQ, head]  
[2013-12-19 10:28:41,019][INFO][node] [es-01]  
initialized  
[2013-12-19 10:28:41,020][INFO][node] [es-01]  
starting ...  
[2013-12-19 10:28:41,125][INFO][transport] [es-01]  
bound\_address {inet[/10.0.8.107:9300]}, publish\_address  
{inet[/10.0.8.107:9300]}  
[2013-12-19 10:28:45,667][INFO][cluster.service] [es-01]  
new\_master  
[es-01][giHKrLdWS5GDR42bnOdQjA][inet[/10.0.8.107:9300]]{master=true},  
reason: zen-disco-join (elected\_as\_master)  
[2013-12-19 10:28:45,689][INFO][discovery] [es-01]  
es-ket/giHKrLdWS5GDR42bnOdQjA  
[2013-12-19 10:28:45,694][INFO][http] [es-01]  
bound\_address {inet[/10.0.8.107:9200]}, publish\_address  
{inet[/10.0.8.107:9200]}  
[2013-12-19 10:28:45,694][INFO][node] [es-01] started

So my question is, which value should I take into account ?

I assume - and hope 😉 - that the correct value is the one displayed  
through the API but I'd like someone to confirm this.

Thank you

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/39da5398-d256-4c3e-99de-9fdb76ff9c7e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/39da5398-d256-4c3e-99de-9fdb76ff9c7e%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Jason\_Wee](https://avatars.discourse-cdn.com/v4/letter/j/7ea924/32.png) [@Jason\_Wee](https://discuss.elastic.co/u/Jason_Wee)\
**Post date:** [December 19, 2013, 10:07am UTC](https://discuss.elastic.co/t/max-file-descriptors-value-differs-in-log-file-and-through-api/14946/2 "2013-12-19T10:07:20Z")

</div>

Works for me (es version 0.90.7), my settings

elasticsearch soft nofile 65536  
elasticsearch hard nofile 131072

and calling the es api, and it show tallied.

"max\_file\_descriptors" : 131072

/Jason

On Thu, Dec 19, 2013 at 5:34 PM, havetobe unknown \<[havetobeunknown@gmail.com](mailto:havetobeunknown@gmail.com)

> wrote:

> Hello,
> 
> When I change the value for "max\_file\_descriptors" - say to 130000 for  
> example - using the MAX\_OPEN\_FILES variable in init script, I noticed a  
> strange behavior. The value dispalyed through API seems correct as shown  
> below (ES version is 0.90.5) :
> 
> curl -XGET '[http://localhost:9200/\_nodes/\_local?process=true&pretty=true](http://localhost:9200/_nodes/_local?process=true&pretty=true)'
> 
> {  
> "ok" : true,  
> "cluster\_name" : "es-clust",  
> "nodes" : {  
> "5PHUSFl2TmW-3yCdisBWZg" : {  
> "name" : "es-01",  
> "transport\_address" : "inet[/10.0.8.107:9300]",  
> "hostname" : "es-01",  
> "version" : "0.90.5",  
> "http\_address" : "inet[/10.0.8.107:9200]",  
> "attributes" : {  
> "master" : "true"  
> },  
> "process" : {  
> "refresh\_interval" : 1000,  
> "id" : 2633,  
> _"max\_file\_descriptors" : 200000_  
> }  
> }  
> }  
> }
> 
> At the same time, I set the _-Des.max-open-files=true_ JVM option to have  
> the value written in ES log file. This doesn't return the same value :
> 
> _[2013-12-19 10:14:28,614][INFO][bootstrap]  
> max\_open\_files [97518]_  
> [2013-12-19 10:14:28,727][INFO][node] [es-01]  
> version[0.90.5], pid[2633], build[c8714e8/2013-09-17T12:50:20Z]  
> [2013-12-19 10:14:28,733][INFO][node] [es-01]  
> initializing ...  
> [2013-12-19 10:14:28,742][INFO][plugins] [es-01] loaded  
> , sites [HQ, head]  
> [2013-12-19 10:14:31,431][INFO][node] [es-01]  
> initialized  
> [2013-12-19 10:14:31,431][INFO][node] [es-01]  
> starting ...  
> [2013-12-19 10:14:31,528][INFO][transport] [es-01]  
> bound\_address {inet[/10.0.8.107:9300]}, publish\_address {inet[/  
> 10.0.8.107:9300]}  
> [2013-12-19 10:14:36,095][INFO][cluster.service] [es-01]  
> new\_master [es-01][5PHUSFl2TmW-3yCdisBWZg][inet[/10.0.8.107:9300]]{master=true},  
> reason: zen-disco-join (elected\_as\_master)  
> [2013-12-19 10:14:36,127][INFO][discovery] [es-01]  
> es-ket/5PHUSFl2TmW-3yCdisBWZg  
> [2013-12-19 10:14:36,131][INFO][http] [es-01]  
> bound\_address {inet[/10.0.8.107:9200]}, publish\_address {inet[/  
> 10.0.8.107:9200]}  
> [2013-12-19 10:14:36,132][INFO][node] [es-01] started
> 
> I found that the value displayed in log file never gets higher than  
> _97518_. If I set a value under this apparent "limit" - say 75000 for  
> instance - the result seems (nearly) correct in log file (as well as  
> through the API) :
> 
> _[2013-12-19 10:28:38,002][INFO][bootstrap]  
> max\_open\_files [74975]_  
> [2013-12-19 10:28:38,128][INFO][node] [es-01]  
> version[0.90.5], pid[2835], build[c8714e8/2013-09-17T12:50:20Z]  
> [2013-12-19 10:28:38,128][INFO][node] [es-01]  
> initializing ...  
> [2013-12-19 10:28:38,137][INFO][plugins] [es-01] loaded  
> , sites [HQ, head]  
> [2013-12-19 10:28:41,019][INFO][node] [es-01]  
> initialized  
> [2013-12-19 10:28:41,020][INFO][node] [es-01]  
> starting ...  
> [2013-12-19 10:28:41,125][INFO][transport] [es-01]  
> bound\_address {inet[/10.0.8.107:9300]}, publish\_address {inet[/  
> 10.0.8.107:9300]}  
> [2013-12-19 10:28:45,667][INFO][cluster.service] [es-01]  
> new\_master [es-01][giHKrLdWS5GDR42bnOdQjA][inet[/10.0.8.107:9300]]{master=true},  
> reason: zen-disco-join (elected\_as\_master)  
> [2013-12-19 10:28:45,689][INFO][discovery] [es-01]  
> es-ket/giHKrLdWS5GDR42bnOdQjA  
> [2013-12-19 10:28:45,694][INFO][http] [es-01]  
> bound\_address {inet[/10.0.8.107:9200]}, publish\_address {inet[/  
> 10.0.8.107:9200]}  
> [2013-12-19 10:28:45,694][INFO][node] [es-01] started
> 
> So my question is, which value should I take into account ?
> 
> I assume - and hope 😉 - that the correct value is the one displayed  
> through the API but I'd like someone to confirm this.
> 
> Thank you
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/39da5398-d256-4c3e-99de-9fdb76ff9c7e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/39da5398-d256-4c3e-99de-9fdb76ff9c7e%40googlegroups.com)  
> .  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAHO4itwTS\_5k7R8A\_qaTFkUo0tW0WV4x2c6CUdyyXJ054fvgNA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAHO4itwTS_5k7R8A_qaTFkUo0tW0WV4x2c6CUdyyXJ054fvgNA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [December 19, 2013, 10:53am UTC](https://discuss.elastic.co/t/max-file-descriptors-value-differs-in-log-file-and-through-api/14946/3 "2013-12-19T10:53:24Z")

</div>

What operating system is this? And are you on a virtual machine?

Jörg

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoFFft8Yae%3D78xjrwRaK-UmFKVra8jGxxKbX%3DDnDNnfM\_A%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoFFft8Yae%3D78xjrwRaK-UmFKVra8jGxxKbX%3DDnDNnfM_A%40mail.gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![havetobe\_unknown](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/havetobe_unknown/32/4489_2.png) [@havetobe\_unknown](https://discuss.elastic.co/u/havetobe_unknown)\
**Post date:** [December 19, 2013, 3:35pm UTC](https://discuss.elastic.co/t/max-file-descriptors-value-differs-in-log-file-and-through-api/14946/4 "2013-12-19T15:35:54Z")

</div>

@ Jason

I don't use limits.conf to set the limits for file descriptors. I directly  
set a variable in the init script but the principle stays the same. The  
value returned throug ES API is also correct for me. It's the value  
displayed in ES log file which differs (when using the -des.max-open-files  
JVM option).

@Jörg

OS is a Debian Squeeze (7.2) up-to-date running in a VM (Vsphere)

Thanks for your time

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/51fc1010-22d4-4893-a9f4-50104387eb87%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/51fc1010-22d4-4893-a9f4-50104387eb87%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:00am UTC](https://discuss.elastic.co/t/max-file-descriptors-value-differs-in-log-file-and-through-api/14946/5 "2017-07-06T02:00:10Z")

</div>


