hyperd icon indicating copy to clipboard operation
hyperd copied to clipboard

Increase file watch limit within pod

Open svarlamov opened this issue 6 years ago • 4 comments

My application watches a large number of files, however, after setting a few thousand watches, the process inside the container begins to receive errors regarding the inotify limits. When I run the command to increase the watch limit in docker build (sudo sysctl fs.inotify.max_user_watches=<some random high number>), it gives an error from docker regarding "read-only filesystem" -- which is a well-documented docker limitation. It seems that this must be run at the host level, i.e., the 'pod' VM in the Hyper architecture. Is there a work around for this in the current implementation? Ideally some way that can be specified automatically at run-time. Thanks!

svarlamov avatar May 07 '18 06:05 svarlamov

Running it within the container while it's actually running seems to work (thanks Hyper.sh support):

echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

However, it doesn't seem like we have a way to set this at build-time...

svarlamov avatar May 08 '18 08:05 svarlamov

What about set it inside your app?

ls -al /proc/sys/fs/inotify/max_user_watches -rw-r--r-- 1 root root 0 5月 8 16:36 /proc/sys/fs/inotify/max_user_watches

teawater avatar May 08 '18 08:05 teawater

@teawater That also works. For now I just have it our entrypoint script

svarlamov avatar May 08 '18 08:05 svarlamov

Opted out of including it in the source as that would not be nice for users/devs who run locally

svarlamov avatar May 08 '18 08:05 svarlamov