Skip to content
This repository has been archived by the owner on Feb 8, 2021. It is now read-only.

Increase file watch limit within pod #718

Open
svarlamov opened this issue May 7, 2018 · 4 comments
Open

Increase file watch limit within pod #718

svarlamov opened this issue May 7, 2018 · 4 comments

Comments

@svarlamov
Copy link

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
Copy link
Author

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...

@teawater
Copy link
Member

teawater commented May 8, 2018

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

@svarlamov
Copy link
Author

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

@svarlamov
Copy link
Author

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants