You are not logged in.

#1 2023-04-13 06:24:40

snack
Member
From: Italy
Registered: 2009-01-13
Posts: 866

Too high ulimit on open files in docker

Hi, since docker 23.0.x my containerized application is misbehaving. I traced the problem to be related to the maximum allowed number of opened file (ulimit -n) which if i'm correct has been raised from 1048576 (docker 20.10.23) to 1073741816 (docker 23.0.3). This makes my application loop forever. I can fix the issue by starting the container with the `--ulimit nofile=1048576:1048576` option, but I'd like to understand if there is a way to set this parameter globally so I don't have to set it in every CL invocation.

Offline

#2 2023-04-13 06:40:34

snack
Member
From: Italy
Registered: 2009-01-13
Posts: 866

Re: Too high ulimit on open files in docker

I figured out the solution. I added the following to /etc/docker/daemon.json:

    "default-ulimits": {
      "nofile": {
        "Hard": 1048576,
        "Name": "nofile",
        "Soft": 1048576
      }
    }

as explained here, restarted the docker daemon. and now the limits are applied to all the containers I start.

Offline

Board footer

Powered by FluxBB