Mongo 7.0.15-9 and Release of Open Files

Good morning,

Lately our percona instances are coming down a lot due to the TooManyOpenFiles error:

{“t”:{“$date”:“2025-07-18T10:00:25.806+02:00”},“s”:“E”, “c”:“NETWORK”, “id”:6328201, “ctx”:“conn670”,“msg”:“Unable to create eventfd object”,“attr”:{“error”:{“code”:264,“codeName”:“TooManyFilesOpen”,“errmsg”:“error in creating eventfd: Too many open files, errno: 24”}}}

or

{“t”:{“$date”:“2025-07-19T13:00:23.589+02:00”},“s”:“I”, “c”:“NETWORK”, “id”:23018, “ctx”:“listener”,“msg”:“Error accepting new connection on local endpoint”,“attr”:{“localEndpoint”:“0.0.0.0:20100”,“error”:“Too many open files”}}

We’ve noticed that this is happening mainly with version 7.0.15-9 with Ubuntu 22.04.5 LTS Operating System.

I’ve tried to see if there was some mention of this on the release notes and I don’t see anything related to open files on:

As anyone else have the same issue?

Regards,

André Ferreira

Hi, the OS default max open files is usually low for MongoDB. Have you increased it? typically for prod 64000 is the recommended number.

Yes, we’ve 204800 (or bigger) on all of our servers.

@afmf you might have to check specific to the mongod user/process:

  1. Check number of open files using lsof -u mongod
  2. Check the current limits for the mongod process
    1. pidof mongod
    2. cat /proc/<pid>/limits
  3. If the limit has reached, either:
    1. Increase ulimits in /etc/security/limits.conf and restart mongod
    2. Use connection pooling (if above not feasible)

Hope that helps.

Regards,

Ezhilan Ulaganathan