# ERR Failed opening: too many open files

**URL:** <https://discuss.elastic.co/t/err-failed-opening-too-many-open-files/46733>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [April 7, 2016, 7:17pm UTC](https://discuss.elastic.co/t/err-failed-opening-too-many-open-files/46733 "2016-04-07T19:17:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rajkamalkool6](https://avatars.discourse-cdn.com/v4/letter/r/e9c0ed/32.png) [@rajkamalkool6](https://discuss.elastic.co/u/rajkamalkool6)\
**Post date:** [April 7, 2016, 7:17pm UTC](https://discuss.elastic.co/t/err-failed-opening-too-many-open-files/46733/1 "2016-04-07T19:17:46Z")

</div>

Hi,

I am using `logstash 2.3.0` and `Filebeat 1.2.0`. I have upgraded `logstash-input-beats to 2.2.7`.

I ran filebeat using the below command  
`/bin/filebeat -c /config/filebeat.yml -e -v "*"`. I am getting below error.

> 2016/04/07 19:12:56.919663 log.go:248: ERR Failed opening /logs/3ea66588f58a.xml: open /logs/3ea66588f58a.xml: too many open files  
> 2016/04/07 19:12:56.919686 log.go:103: ERR Stop Harvesting. Unexpected file opening error: open /logs/3ea66588f58a.xml: too many open files.

Is there any bug in this version?

Thanks in advance

---

<div class="post-metadata">

**Author:** ![steffens](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/steffens/32/79630_2.png) [@steffens](https://discuss.elastic.co/u/steffens)\
**Post date:** [April 7, 2016, 10:17pm UTC](https://discuss.elastic.co/t/err-failed-opening-too-many-open-files/46733/2 "2016-04-07T22:17:04Z")

</div>

Limit of open files is determined by OS. Check ulimit. Filebeat keeps files open for quite some time (search for `close_older` option). Files are finally closed after `close_older` (default 1h). If new files get generated and written to very fast, reduce `close_older` maybe to a few minutes. `close_older` should be big enough to not close file between consecutive writes by accident, which is not too bad though as prospector will reopen file in that case.

---

<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, 9:53pm UTC](https://discuss.elastic.co/t/err-failed-opening-too-many-open-files/46733/3 "2017-07-05T21:53:37Z")

</div>


