We need to create some documentation that explains how to properly modify our SystemD service file to include numactl for systems using NUMA. The original SysV init scripts used to do this but very few customers, if any, are still using those as most Linux distros have phased that out in favor of SystemD.
The steps required are as follows:
- copy /lib/systemd/system/mongod.service to /etc/systemd/system/mongod.service
- modify /etc/systemd/system/mongod.service such that the line "ExecStart=/usr/bin/mongod --config /etc/mongod.conf" is now "ExecStart=/usr/bin/numactl --interleave=all /usr/bin/mongod --config /etc/mongod.conf"
- run `systemctl stop mongod`
- run `systemctl daemon-reload`
- run `systemctl start mongod`
I'm not sure if the path to numactl is exactly correct (/usr/bin/numactl) or what the normal path for it is. That's just an educated guess as I don't have access to a NUMA enabled system.