Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raise NOFILE limits on host to 1048576 #24

Open
curtishall opened this issue Aug 4, 2023 · 1 comment
Open

Raise NOFILE limits on host to 1048576 #24

curtishall opened this issue Aug 4, 2023 · 1 comment

Comments

@curtishall
Copy link
Member

Some Linux distributions (I'm looking at you Arch) change the limit of NOFILE to 65536 instead of the recommended (and default by Docker) 1048576

moby/moby@428d733

This causes some random problems, especially with rsyslog using 100% CPU

Latest Arch:

cat /proc/$(pgrep containerd | head -1)/limits | grep files
Max open files 65536 65536 files

@curtishall
Copy link
Member Author

Something like this should help:

docker_no_file_limits {

current_value=$(cat /proc/$(pgrep containerd | head -1)/limits | grep files | awk '{print $4}')

Check if the current value is 65536

if [ "$current_value" -eq 65536 ]; then
# Run the command to update the Docker on the host
echo "[Service]
LimitNOFILE=1048576" > /etc/systemd/system/docker.service.d/override.conf

# Reload the systemd configuration
systemctl daemon-reload

# Restart the Docker service
systemctl restart docker

echo "Host NOFILE limit for Docker service configuration updated."

else
echo "Value is not 65536, skipping the command."
fi

}

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

No branches or pull requests

1 participant