# Too many open files

**URL:** <https://discuss.elastic.co/t/too-many-open-files/4172>\
**Category:** Elasticsearch\
**Created:** [March 30, 2011, 7:14pm UTC](https://discuss.elastic.co/t/too-many-open-files/4172 "2011-03-30T19:14:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tetlika](https://avatars.discourse-cdn.com/v4/letter/t/c6cbf5/32.png) [@tetlika](https://discuss.elastic.co/u/tetlika)\
**Post date:** [March 30, 2011, 7:14pm UTC](https://discuss.elastic.co/t/too-many-open-files/4172/1 "2011-03-30T19:14:54Z")

</div>

Hi!

we have increased the number of open files in /etc/security/limits...  
to 200000 but still getting errors:

Caused by: java.io.FileNotFoundException: (Too many open files)

---

<div class="post-metadata">

**Author:** ![Ludovic\_Levesque](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ludovic_levesque/32/3031_2.png) [@Ludovic\_Levesque](https://discuss.elastic.co/u/Ludovic_Levesque)\
**Post date:** [March 30, 2011, 7:47pm UTC](https://discuss.elastic.co/t/too-many-open-files/4172/2 "2011-03-30T19:47:00Z")

</div>

Hi

did you check the current limits with ulimit after setting this value  
into /etc/security/limits ?

Ludo

On Wed, Mar 30, 2011 at 9:14 PM, tetlika [tetlika@gmail.com](mailto:tetlika@gmail.com) wrote:

> Hi!
> 
> we have increased the number of open files in /etc/security/limits...  
> to 200000 but still getting errors:
> 
> Caused by: java.io.FileNotFoundException: (Too many open files)

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [March 31, 2011, 3:50pm UTC](https://discuss.elastic.co/t/too-many-open-files/4172/3 "2011-03-31T15:50:27Z")

</div>

You can make sure that the setting has been applies to the elasticsearch process by passing -Des.max-open-files=true to the script. Check here: [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/setup/installation.html).  
On Wednesday, March 30, 2011 at 9:47 PM, Ludovic Levesque wrote:

> Hi
> 
> did you check the current limits with ulimit after setting this value  
> into /etc/security/limits ?
> 
> Ludo
> 
> On Wed, Mar 30, 2011 at 9:14 PM, tetlika [tetlika@gmail.com](mailto:tetlika@gmail.com) wrote:
> 
> > Hi!
> > 
> > we have increased the number of open files in /etc/security/limits...  
> > to 200000 but still getting errors:
> > 
> > Caused by: java.io.FileNotFoundException: (Too many open files)

---

<div class="post-metadata">

**Author:** ![Lee\_Parker](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lee_parker/32/3250_2.png) [@Lee\_Parker](https://discuss.elastic.co/u/Lee_Parker)\
**Post date:** [March 31, 2011, 3:55pm UTC](https://discuss.elastic.co/t/too-many-open-files/4172/4 "2011-03-31T15:55:15Z")

</div>

If you are starting elastic from an init script, setting the file limit in  
/etc/security/limits doesn't apply. You will need to put a ulimit -a 200000  
line in the init script itself. This will only work if you are running  
elastic as root.

## Lee

"It doesn't matter whether you are liberal or conservative, but it's  
dangerous to always think with exclamation points instead of question  
marks."  
by Marty Beckerman  
On Thu, Mar 31, 2011 at 10:50 AM, Shay Banon  
[shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)wrote:

> You can make sure that the setting has been applies to the elasticsearch  
> process by passing -Des.max-open-files=true to the script. Check here:  
> [Elastic — The Search AI Company | Elastic](http://www.elasticsearch.org/guide/reference/setup/installation.html).
> 
> On Wednesday, March 30, 2011 at 9:47 PM, Ludovic Levesque wrote:
> 
> Hi
> 
> did you check the current limits with ulimit after setting this value  
> into /etc/security/limits ?
> 
> Ludo
> 
> On Wed, Mar 30, 2011 at 9:14 PM, tetlika [tetlika@gmail.com](mailto:tetlika@gmail.com) wrote:
> 
> Hi!
> 
> we have increased the number of open files in /etc/security/limits...  
> to 200000 but still getting errors:
> 
> Caused by: java.io.FileNotFoundException: (Too many open files)

---

<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, 4:09am UTC](https://discuss.elastic.co/t/too-many-open-files/4172/5 "2017-07-06T04:09:03Z")

</div>


