docker-zulip icon indicating copy to clipboard operation
docker-zulip copied to clipboard

Error: The minimum number of file descriptors required to run this process is 40000

Open flavienbwk opened this issue 4 years ago • 5 comments

Hi,

I am trying to run Zulip with Docker rootless on my server but I get the following error :

zulip_1      | Error: The minimum number of file descriptors required to run this process is 40000 as per the "minfds" command-line argument or config file setting. The current environment will only allow you to open 40000 file descriptors.  Either raise the number of usable file descriptors in your environment (see README.rst) or lower the minfds setting in the config file to allow the process to start.
zulip_1      | For help, use /usr/bin/supervisord -h

This happens when removing :

    ulimits:
      nofile:
        soft: 40000
        hard: 50000

from the docker-compose file, because I can't use it (getting the following error).

Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused "process_linux.go:449: container init caused \"process_linux.go:378: setting rlimits for ready process caused \\\"error setting rlimit type 7: operation not permitted\\\"\"": unknown
Error: failed to start containers

Why are ulimits needed and do you have an idea on how to solve this problem ?

Thank you

flavienbwk avatar May 09 '20 16:05 flavienbwk

Ulimit definition :

Ulimit is the number of open file descriptors per process. It is a method for restricting the number of various resources a process can consume. Sometimes you will get the error message is like “too many files open “, it is because you have reached the limits of opened files, so you need to increase the ulimit parameters.

The answer is, docker-rootless doesn't work as the classic Docker version. For increasing the ulimit, please refer to this issue.

And remove the ulimits part from the docker-compose file.

Important note : in Docker Rootless, ulimits work in process-granularity rather than in container-granularity.

flavienbwk avatar May 10 '20 01:05 flavienbwk

Reopening this since I'd like us to document this issue with docker-rootless.

timabbott avatar Jun 11 '20 18:06 timabbott

I'd have two remarks :

  1. Zulip is compatible with Docker rootless. You "just" have to raise your Linux user ulimits (which is not really easy tho).

  2. I guess most people don't have "thousands" of users in their Zulip system. So setting the ulimits shouldn't be mandatory by default and should be an option.

flavienbwk avatar Jul 01 '20 19:07 flavienbwk

@flavienbwk interesting; I wouldn't have expected that to be the only problem. Can you confirm that everything works with that change?

In theory we could add a zulip.conf setting for this; it's just a bit of work to do so and test doing so.

And it's not thousands of users, it's thousands of open files, which can happen with hundreds of concurrent users.

timabbott avatar Jul 07 '20 01:07 timabbott

Good idea. Yes I've been using it with a bit older version of Zulip ( May 9th) without an issue. Tho I didn't use it with a lot of people (~10).

Just a last comment about ulimits : the only container I've seen requesting ulimits is ElasticSearch (at 65000). As a way lighter system, I suspect that Zulip may not need raised ulimits by default.

flavienbwk avatar Jul 09 '20 21:07 flavienbwk