Vm.max_map_count recommendations, mongodb 6/7?

Hi all, first post.
Is there an official recommendation for this ?
All I could see in mongodb documentation is a “start point” of 131060
mongosh is moaning even when I set to 256000
chatgpt came up with a “mongodb recommended” of databases * cpus * 65536 which would equate nearly 20,000,000 on the server I’m interested in.

Running mongodb 6.0.14 on an AWS instance with 96 cpu and 384 Gb memory, in a docker container, on Ubuntu 22.04.

Any pointers to docs, or general recommendations welcomed.
Many thanks

Hi @Derek_Cox

The full log output suggests the recommended value for the configured system. Check the log or use db.adminCommand({getLog: 'startupWarnings'}).log.forEach(l => printjson(l))

If the Operations Checklist, UNIX ulimit Settings and Production Notes were followed then this value should be 102400.

This is derived from net.maxIncomingConnections * 2

The default net.maxIncomingConnections per the below should be 64000 * 0.8

64000 from the ulimit set(this is usually done in the mongod.service file for RPM and deb installs)

https://www.mongodb.com/docs/manual/reference/configuration-options/#mongodb-setting-net.maxIncomingConnections

net.maxIncomingConnections

Type: integer

Default (Windows): 1,000,000

Default (Linux): (RLIMIT_NOFILE) * 0.8

https://github.com/mongodb/mongo/blob/e1aa498db8bee013a82646b02f04ee878e0e4bbf/src/mongo/db/startup_warnings_mongod.cpp#L286

size_t requiredMapCount = 2 * maxConns;

Hi Chris, thanks for the response, really useful.
The vendor configuration sets ulimit:nofiles:soft to 500k, so connections will be set to 400k and therefore vm.max_map_count should be 800k

nofile 64000 is a good starting point per

https://www.mongodb.com/docs/manual/reference/ulimit/

Which would yield 102400 for vm.max_map_count

For the system, if mongod were running native from installation repos nofile would be set to 64000 for the systemd unit file.

As it is running in container that change would have to be made in docker-compose or docker run instead.