inotify
: ‘too many open files’
inotify is a part of the Linux kernel which can be used to monitors changes to the filesystem. Among other softwares, this interface is used by the file watcher of Deno, a JavaScript runtime used by Quarto. Rendering a large project often leads to the message
Error: Too many open files (os error 24)
This is caused by Deno reaching the limit of /proc/sys/fs/inotify/max_user_instances
, which by default is 128.
The limit can be temporarily raised by
echo "1024" | sudo tee /proc/sys/fs/inotify/max_user_instances
and permanently by an entry
fs.inotify.max_user_instances=1024
in /etc/sysctl.conf
, the configuration file for the kernel parameter configuration tool sysctl
. For the change to take effect immediately,
sudo sysctl -p
is necessary.
sysctl
is not related to systemd, but it is controlled by a systemd service systemd-sysctl.service
, and therefore
sudo systemctl restart systemd-sysctl.service
can be used instead.