# Logstash failing with "ERROR::EMFILE- Too many open files"

**URL:** <https://discuss.elastic.co/t/logstash-failing-with-error-emfile-too-many-open-files/190715>\
**Category:** Logstash\
**Created:** [July 16, 2019, 11:09am UTC](https://discuss.elastic.co/t/logstash-failing-with-error-emfile-too-many-open-files/190715 "2019-07-16T11:09:24Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [July 18, 2019, 7:10pm UTC](https://discuss.elastic.co/t/logstash-failing-with-error-emfile-too-many-open-files/190715/7 "2019-07-18T19:10:26Z")

</div>

In tail mode I can see why you would want to tail a large number of files, but in read mode logstash is going to open a file, read the whole file, and process the whole file through the pipeline. That's basically going to keep 1 CPU busy. I would not set the open file limit much above the number of CPUs that you have. If you increase it further then if anything I would expect throughput to get worse.

Are you deleting files and then adding more files? That can result in [inode reuse](https://discuss.elastic.co/t/logstash-configuration-returns-different-results/190471/11).

---

_[View the full topic](https://discuss.elastic.co/t/logstash-failing-with-error-emfile-too-many-open-files/190715)._
