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

natten

New Member
Jul 21, 2016
3
1
3
29
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
720
123
68
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
 
  • Like
Reactions: flotho

natten

New Member
Jul 21, 2016
3
1
3
29
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

Active Member
Apr 21, 2015
23
5
28
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
32
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.
 

Bidi

Active Member
Feb 12, 2016
106
2
43
35
Hello,

I got an 4 x CPU total 80 Cores with 512GB Ram i have around 55 lxc on it, the cpu is 0 chill, ram usage 20gb,

sysctl fs.inotify.max_user_instances=512

Fixed my issue.

I think this should be considering increasead from the instalation of on server because i`m not the only one with powerfull servers

proxmox 5.4
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, 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!