hyperd
hyperd copied to clipboard
Increase file watch limit within pod
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!
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...
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 That also works. For now I just have it our entrypoint script
Opted out of including it in the source as that would not be nice for users/devs who run locally