By default, CoreOS and the Linux kernel has some pretty conservative limits defined for things such as open files and locked memory.
So I upped the values in /etc/systemd/system.conf:
DefaultLimitNOFILE=500000
DefaultLimitMEMLOCK=unlimited
However, when I start my docker containers the limits are still low. ulimit -l prints 64.
Running ulimit -l unlimited prints an error.
ulimit: max locked memory: cannot modify limit: Operation not permitted
So I placed
LimitMAXLOCKED=unlimited
LimitNOFILE=64000
In my systemd unit file.
However, these values are not coming through to the docker container and calling them still doesn't work. I've rebooted the machine after changing the systemwide defaults.
This is probably more of a systemd thing. How do I fix this?
Docker containers are not started nor managed by systemd. The Docker daemon is responsible for setting limits here. Here is an example taken from the official documentation:
# docker run --ulimit nofile=1024:1024 --rm debian sh -c "ulimit -n"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With