# Kibana fails after several days or hours of work due to reaching nofile ulimit

**URL:** <https://discuss.elastic.co/t/kibana-fails-after-several-days-or-hours-of-work-due-to-reaching-nofile-ulimit/150898>\
**Category:** Kibana\
**Created:** [October 3, 2018, 1:29pm UTC](https://discuss.elastic.co/t/kibana-fails-after-several-days-or-hours-of-work-due-to-reaching-nofile-ulimit/150898 "2018-10-03T13:29:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vara0855](https://avatars.discourse-cdn.com/v4/letter/v/3da27b/32.png) [@vara0855](https://discuss.elastic.co/u/vara0855)\
**Post date:** [October 3, 2018, 1:29pm UTC](https://discuss.elastic.co/t/kibana-fails-after-several-days-or-hours-of-work-due-to-reaching-nofile-ulimit/150898/1 "2018-10-03T13:29:38Z")

</div>

I have such ulimits on my server:

> address space limit (Kibytes) (-M) unlimited  
> core file size (blocks) (-c) unlimited  
> cpu time (seconds) (-t) unlimited  
> data size (Kibytes) (-d) unlimited  
> file size (blocks) (-f) unlimited  
> locks (-x) unlimited  
> locked address space (Kibytes) (-l) unlimited  
> message queue size (Kibytes) (-q) 800  
> nice (-e) 0  
> nofile (-n) 65563  
> nproc (-u) 100000  
> pipe buffer size (bytes) (-p) 4096  
> max memory size (Kibytes) (-m) unlimited  
> rtprio (-r) 0  
> socket buffer size (bytes) (-b) 4096  
> sigpend (-i) 31142  
> stack size (Kibytes) (-s) 8192  
> swap size (Kibytes) (-w) not supported  
> threads (-T) not supported  
> process size (Kibytes) (-v) unlimited

When reaching limit of connections Kibana falls with next error:

> Error: ENFILE: file table overflow, uv\_resident\_set\_memory

---

<div class="post-metadata">

**Author:** ![rashmi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rashmi/32/16391_2.png) [@rashmi](https://discuss.elastic.co/u/rashmi)\
**Post date:** [October 3, 2018, 4:55pm UTC](https://discuss.elastic.co/t/kibana-fails-after-several-days-or-hours-of-work-due-to-reaching-nofile-ulimit/150898/2 "2018-10-03T16:55:01Z")

</div>

There might be multiple reasons for this . Each OS handles this a bit differently. Some have a max files per process setting. Can you try getting the output of `cat /etc/sysctl.conf` to see if there’s a max file per process setting in the there that could be changed? Not sure if that file exists on all OSes though.  
Definitely on MacOS. On MacOS, this is how we would fix it:

```auto
echo kern.maxfiles=65536 | sudo tee -a /etc/sysctl.conf
$ echo kern.maxfilesperproc=65536 | sudo tee -a /etc/sysctl.conf
$ sudo sysctl -w kern.maxfiles=65536
$ sudo sysctl -w kern.maxfilesperproc=65536
$ ulimit -n 65536

```

More logs and info about what OS you are running on might help. Also maybe disabling the optimizer would “help” but not be a good real solution. Optimizer creates new files on disk I believe so it could be causing the file limit problem. Or it could be one of the plugins you have installed? It could be anything .

hope this helps,  
Cheers  
Rashmi

---

<div class="post-metadata">

**Author:** ![vara0855](https://avatars.discourse-cdn.com/v4/letter/v/3da27b/32.png) [@vara0855](https://discuss.elastic.co/u/vara0855)\
**Post date:** [October 4, 2018, 9:28am UTC](https://discuss.elastic.co/t/kibana-fails-after-several-days-or-hours-of-work-due-to-reaching-nofile-ulimit/150898/3 "2018-10-04T09:28:17Z")

</div>

My OS is Linux.

cat /etc/sysctl.conf -\>

> System default settings live in /usr/lib/sysctl.d/00-system.conf.  
> To override those settings, enter new settings here, or in an /etc/sysctl.d/.conf file
> 
> For more information, see sysctl.conf(5) and sysctl.d(5).  
> kernel.sem = 250 1024000 32 5120  
> kernel.core\_pattern = /var/core/core-%e-sig%s-user%u-group%g-pid%p-time%t  
> kernel.core\_uses\_pid = 1  
> fs.suid\_dumpable = 2  
> vm.swappiness = 0  
> vm.max\_map\_count = 262144  
> fs.file-max = 16384

Kibana Version = 5.1.2

I have open source version of Kibana without xPack. I use some of my kibana-plugins (I don't think that this is the problem, because on other servers there is no such problem.)

---

<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:** [November 1, 2018, 9:28am UTC](https://discuss.elastic.co/t/kibana-fails-after-several-days-or-hours-of-work-due-to-reaching-nofile-ulimit/150898/4 "2018-11-01T09:28:26Z")

</div>

Closed on November 1, 2018, 9:28am UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
