fs.inotify.max_user_watches 系统控制
fs.inotify.max_user_watches sysctl
我正在使用 arch linux 并安装 ember-cli。
在 ember serve
我收到以下消息:
A non-recoverable condition has triggered. Watchman needs your help!
The triggering condition was at timestamp=1452004013: inotify-add-watch(/home/cristian/projects/transport-company/node_modules/ember-cli/node_modules/testem/node_modules/socket.io-pure/node_modules/socket.io-client-pure/node_modules/engine.io-client-pure/node_modules/parseuri/node_modules/better-assert/node_modules/callsite) -> The user limit on the total number of inotify watches was reached; increase the fs.inotify.max_user_watches sysctl
All requests will continue to fail with this message until you resolve
the underlying problem. You will find more information on fixing this at
https://facebook.github.io/watchman/docs/troubleshooting.html#poison-inotify-add-watch
有人可以帮忙吗?
通常最好检查一下抱怨的软件是否真的应该使用那么多资源。
只是为了测试,您可以尝试 sudo sysctl fs.inotify.max_user_watches=…
使用比现在更大的数字(sudo sysctl fs.inotify.max_user_watches
以获得当前值)。
如果找到正确的值,请将其永久设置在 /etc/sysctl.d/
文件中。
官方文档说:
如果您遇到这种情况,则意味着您的内核无法在您要求它监视的一个或多个根目录中监视一个目录。 Watchman 认为 non-recoverable 这种特殊情况是因为 Watchman 服务所做的任何事情都不能保证根本原因得到解决,并且当系统处于这种状态时,Watchman 不能保证它可以响应其客户所依赖的正确结果。我们认为自己中毒了,并且在进程重新启动之前,所有手表(不仅仅是它触发的手表)的所有请求都会失败。
这可能触发的主要原因有两个:
- 已达到用户对 inotify watch 总数的限制或
内核未能分配所需的资源
- 可用内核内存不足
你可以增加max_user_watches:
echo 999999 | sudo tee -a /proc/sys/fs/inotify/max_user_watches
如果您更改了限制,但仍然出现相同的错误,- 重新启动 watchman 进程(自 4.6 起):watchman watch-del-all
watchman shutdown-server
https://facebook.github.io/watchman/docs/troubleshooting.html#i-39-ve-changed-my-limits-how-can-i-clear-the-error
已用:
echo 999999 | sudo tee -a /proc/sys/fs/inotify/max_user_watches && echo 999999 | sudo tee -a /proc/sys/fs/inotify/max_queued_events && echo 999999 | sudo tee -a /proc/sys/fs/inotify/max_user_instances && watchman shutdown-server && sudo sysctl -p
我正在使用 arch linux 并安装 ember-cli。
在 ember serve
我收到以下消息:
A non-recoverable condition has triggered. Watchman needs your help!
The triggering condition was at timestamp=1452004013: inotify-add-watch(/home/cristian/projects/transport-company/node_modules/ember-cli/node_modules/testem/node_modules/socket.io-pure/node_modules/socket.io-client-pure/node_modules/engine.io-client-pure/node_modules/parseuri/node_modules/better-assert/node_modules/callsite) -> The user limit on the total number of inotify watches was reached; increase the fs.inotify.max_user_watches sysctl
All requests will continue to fail with this message until you resolve
the underlying problem. You will find more information on fixing this at
https://facebook.github.io/watchman/docs/troubleshooting.html#poison-inotify-add-watch
有人可以帮忙吗?
通常最好检查一下抱怨的软件是否真的应该使用那么多资源。
只是为了测试,您可以尝试 sudo sysctl fs.inotify.max_user_watches=…
使用比现在更大的数字(sudo sysctl fs.inotify.max_user_watches
以获得当前值)。
如果找到正确的值,请将其永久设置在 /etc/sysctl.d/
文件中。
官方文档说:
如果您遇到这种情况,则意味着您的内核无法在您要求它监视的一个或多个根目录中监视一个目录。 Watchman 认为 non-recoverable 这种特殊情况是因为 Watchman 服务所做的任何事情都不能保证根本原因得到解决,并且当系统处于这种状态时,Watchman 不能保证它可以响应其客户所依赖的正确结果。我们认为自己中毒了,并且在进程重新启动之前,所有手表(不仅仅是它触发的手表)的所有请求都会失败。 这可能触发的主要原因有两个:
- 已达到用户对 inotify watch 总数的限制或 内核未能分配所需的资源
- 可用内核内存不足
你可以增加max_user_watches:
echo 999999 | sudo tee -a /proc/sys/fs/inotify/max_user_watches如果您更改了限制,但仍然出现相同的错误,- 重新启动 watchman 进程(自 4.6 起):
watchman watch-del-all watchman shutdown-serverhttps://facebook.github.io/watchman/docs/troubleshooting.html#i-39-ve-changed-my-limits-how-can-i-clear-the-error
已用:
echo 999999 | sudo tee -a /proc/sys/fs/inotify/max_user_watches && echo 999999 | sudo tee -a /proc/sys/fs/inotify/max_queued_events && echo 999999 | sudo tee -a /proc/sys/fs/inotify/max_user_instances && watchman shutdown-server && sudo sysctl -p