0

After upgrading Docker on my Ubuntu 24.04 Servers to version 29.0.0, Swarm services suddenly inherit:

Max open files: soft=1024, hard=524288

MongoDB, Redis, etc. suddenly throw file descriptor errors like too many open files on Mongo

Adding ulimits to stack YAML fixes it. Downgrading Docker does not fix it.

Why is this the case and how to fix it?

3
  • Seems we are hitting this as well as of yesterday. We pulled in latest docker in a pipeline. For now we are pinning the version and evaluate options tomorrow. Commented Nov 13 at 21:32
  • I read the reason why this Q is closed. Ok, but why isn't this moved to a correct stackexhange site? Something about operations maybe? I'll see if I can do it later. Commented Nov 13 at 21:36
  • So is the whole docker topic is OT on Stackoverflow? Docker clearly is a software tool primarily used by programmers. This is not sysadmin related. Suggestions to edit this correctly would be appreciated. Commented Nov 14 at 12:43

1 Answer 1

0

The containerd.io package for ubuntu 24.04 was upgraded on 2025-11-10 from 1.7.29 to 2.1.5.

This version’s /usr/lib/systemd/system/containerd.service removed:

LimitNOFILE=infinity

As a consequence it seems that containerd now starts with systemd’s default soft limit of 1024 and Docker Swarm inherits these limits. The old behavior (soft=hard=infinity) disappeared.

One can detect this inside a container checking the applied limits on the processes doing e.g.

cat /proc/1/limits

In my case i saw Max open files 1024 524288 .

Checking the containerd version using

$ containerd --version
containerd containerd.io v2.1.5 fcd43222d6b07379a4be9786bda52438f0dd16a1

I could see the containerd version increased to 2.1.5 .

Potential ways to fix

Option 1: Systemd override (global)

We can change this specific behavior while keeping the current containerd version if we reintroduce the LimitNOFILE field into the container.service by doing this:

sudo systemctl edit containerd.service

Then we add the field with a higher number

[Service]
LimitNOFILE=64000

and reload

sudo systemctl daemon-reload
sudo systemctl restart containerd
sudo systemctl restart docker

Option 2: in docker stack YAML

Just add the limits in the yaml file you want to deploy

ulimits:
  nofile:
    soft: 64000
    hard: 64000

Option 3: Downgrading container.io

I did not try this, but a clean uninstall and reinstall of container.io should resolve the issue too.

Note: The issue persists even if you downgrade Docker because containerd.io stays upgraded unless you downgrade manually.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.