# Too many open files error

**URL:** <https://discuss.elastic.co/t/too-many-open-files-error/36789>\
**Category:** Elasticsearch\
**Created:** [December 9, 2015, 7:30pm UTC](https://discuss.elastic.co/t/too-many-open-files-error/36789 "2015-12-09T19:30:11Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Idarlington](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/idarlington/32/19887_2.png) [@Idarlington](https://discuss.elastic.co/u/Idarlington)\
**Post date:** [December 9, 2015, 7:30pm UTC](https://discuss.elastic.co/t/too-many-open-files-error/36789/1 "2015-12-09T19:30:11Z")

</div>

Hello,

Currently using elasticsearch 2.0 , had to create another user to run it since it cant run as root.

I have changed the settings for ulimit in the limits.conf file and also added the required lines in common-session file.

The ulimit for the user is updated but when I check the ulimit for elasticsearch's process id , it is not updated. I have also rebooted the server.

Is there a solution to this ? @s1monw @warkolm

---

<div class="post-metadata">

**Author:** ![msimos](https://avatars.discourse-cdn.com/v4/letter/m/bb73d2/32.png) [@msimos](https://discuss.elastic.co/u/msimos)\
**Post date:** [December 9, 2015, 7:46pm UTC](https://discuss.elastic.co/t/too-many-open-files-error/36789/2 "2015-12-09T19:46:13Z")

</div>

Hi,

I would set /etc/security/limits.conf to something like:

```auto
elasticsearch soft nofile 64000                                                                                                                                                                                                                     
elasticsearch hard nofile 64000 

```

Then reboot your server(s) and when you type `ulimit -a` it should be now set to open files to 64000.

---

<div class="post-metadata">

**Author:** ![Idarlington](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/idarlington/32/19887_2.png) [@Idarlington](https://discuss.elastic.co/u/Idarlington)\
**Post date:** [December 9, 2015, 10:08pm UTC](https://discuss.elastic.co/t/too-many-open-files-error/36789/3 "2015-12-09T22:08:07Z")

</div>

> [@msimos](#):
>
> ulimit -a

yeah, I have added that, the ulimit for the user has been updated, when i check ulimit it confirms that. but when i check elasticsearch's process limits it is not updated

---

<div class="post-metadata">

**Author:** ![msimos](https://avatars.discourse-cdn.com/v4/letter/m/bb73d2/32.png) [@msimos](https://discuss.elastic.co/u/msimos)\
**Post date:** [December 9, 2015, 10:47pm UTC](https://discuss.elastic.co/t/too-many-open-files-error/36789/4 "2015-12-09T22:47:59Z")

</div>

ulimit needs to be set every time before starting the process. So typically this is set in the init script. If you modify the Elasticsearch init script and add ulimit -a do you see this being set? If not then you should either modify /etc/sysconfig/elasticsearch if you're using the RPM. Or use /etc/security/limits.conf to modify this value.

---

<div class="post-metadata">

**Author:** ![Idarlington](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/idarlington/32/19887_2.png) [@Idarlington](https://discuss.elastic.co/u/Idarlington)\
**Post date:** [December 10, 2015, 8:54am UTC](https://discuss.elastic.co/t/too-many-open-files-error/36789/5 "2015-12-10T08:54:59Z")

</div>

Hello, thanks for the help, I solved the problem by adding

> limit nofile 64000 64000

to elasticsearch's init script.

---

<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 5, 2017, 11:32pm UTC](https://discuss.elastic.co/t/too-many-open-files-error/36789/6 "2017-07-05T23:32:06Z")

</div>


