[SOLVED] Failed to allocate directory watch: Too many open files

natten

New Member
Jul 21, 2016
3
1
3
26
Anyone knows what to do with "Failed to allocate directory watch: Too many open files" in containers?

It happens in every container so i suppose its an issue with the host.
I've tried to add the following to the /etc/security/limits.conf on the host but with no luck
Code:
root             -       nofile          unlimited
*                -       nofile          unlimited
Anyone got a clue how i should proceed?
 
  • Like
Reactions: naisanza

wbumiller

Proxmox Staff Member
Staff member
Jun 23, 2015
645
84
28
Do you have lots of containers running? Then you probably ran into the inotify limits:
These are the defaults:
Code:
# sysctl fs.inotify
fs.inotify.max_queued_events = 16384
fs.inotify.max_user_instances = 128
fs.inotify.max_user_watches = 65536
Try increasing the instance limit, eg. # sysctl fs.inotify.max_user_instances=512
 

natten

New Member
Jul 21, 2016
3
1
3
26
Do you have lots of containers running? Then you probably ran into the inotify limits:
These are the defaults:
Code:
# sysctl fs.inotify
fs.inotify.max_queued_events = 16384
fs.inotify.max_user_instances = 128
fs.inotify.max_user_watches = 65536
Try increasing the instance limit, eg. # sysctl fs.inotify.max_user_instances=512
Thanks seems like it worked!
I have 12 containers running with different services.
What are the consequences of increasing this limit, and what is the maximum i should set it to?
 

Kephin

New Member
Apr 21, 2015
8
0
1
Also ran into this issue at about the fifteenth container I was trying to deploy/restore. (during migration from PX3) which is not a lot in our use case. (fairly simple single purpose webserver contianers)
I would definitely say this limit needs increasing OOTB...
 

smacz

New Member
May 19, 2018
1
0
1
29
I just ran into this with 8 LXC containers! Granted, they all were running various daemons...Increasing the `inotify` settings in the `/etc/sysctl.conf` worked like a charm though.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE and Proxmox Mail Gateway. We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get your own in 60 seconds.

Buy now!