Warnings about NUMA while starting up the container
Hi,
I'm running the mongo image on a NUMA-enabled machine, and I get following warning from logs when MongoDB is starting:
WARNING: You are running on a NUMA machine. We suggest launching mongod like this to avoid performance problems: numactl --interleave=all mongod [other options]
How can I resolve this? Any help is appreciated, thanks.
Seccomp is preventing numactl from working correctly, because get_mempolicy and set_mempolicy syscall is restricted in docker containers. Possible workarounds include:
- Run without seccomp:
docker run --security-opt seccomp=unconfined mongo - Run with a custom seccomp profile:
docker run --security-opt seccomp=./seccomp.json mongo
Hope it helps other people who ran into the same problem. Maybe we can add it into docs? For reference: https://docs.docker.com/engine/security/seccomp/
Indeed, adding this to the documentation (https://github.com/docker-library/docs/tree/master/mongo) would be extremely appreciated.
Our current test already includes something like this (creating a custom seccomp profile on the fly): https://github.com/docker-library/official-images/blob/98d3a4d3cecc8b53e0ea547337eeff53ff58710e/test/tests/mongo-basics/run.sh#L6-L53
To improve on this, adding --cap-add SYS_NICE to your container arguments is sufficient to allow NUMA to do the right thing.