[SERVER-12033] Windows is not detecting NUMA settings Created: 10/Dec/13  Updated: 11/Jul/16  Resolved: 17/Dec/13

Status: Closed
Project: Core Server
Component/s: Diagnostics
Affects Version/s: 2.5.4
Fix Version/s: 2.5.5

Type: Bug Priority: Major - P3
Reporter: Alvin Richards (Inactive) Assignee: Mark Benvenuto
Resolution: Done Votes: 1
Labels: 26qa
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to DOCS-2396 NUMA documentation claims it's only a... Closed
Backwards Compatibility: Fully Compatible
Operating System: Windows
Participants:

 Description   

Problem:
./src/mongo/util/processinfo_win32.cpp

See

198     bool ProcessInfo::checkNumaEnabled() {
199         return false;
200     }

Appears that this check assumes that there is no NUMA impact for Windows.

Solution:
It appears that Windows supports APIs to find this info, see

http://msdn.microsoft.com/en-us/library/windows/desktop/aa363804(v=vs.85).aspx

Next Step:
Confirm if NUMA affects Windows in the same way as Linux (assumption is yes).



 Comments   
Comment by Githook User [ 17/Dec/13 ]

Author:

{u'username': u'markbenvenuto', u'name': u'Mark Benvenuto', u'email': u'mark.benvenuto@mongodb.com'}

Message: SERVER-12033: Add proper NUMA check for Windows
Branch: master
https://github.com/mongodb/mongo/commit/7b16d40afbc6320539cb1933b9e6a60d3db86607

Comment by Mark Benvenuto [ 13/Dec/13 ]

One option is to ask the user to disable it in the bios. I added this warning message. If you would like I can use Get/SetProcessAffinityMask to pin mongodb to one NUMA node, but there is no guarantee that Windows will not spill memory allocations over to other nodes once the current node runs low on memory. This may be more confusing to the user.

2013-12-13T15:34:17.121-0500 [initandlisten]
2013-12-13T15:34:17.121-0500 [initandlisten] ** WARNING: You are running on a NUMA machine.
2013-12-13T15:34:17.122-0500 [initandlisten] **          We suggest disabling NUMA in the machine BIOS
2013-12-13T15:34:17.123-0500 [initandlisten] **          by enabling interleaving to avoid performance problems.
2013-12-13T15:34:17.123-0500 [initandlisten] **          See your BIOS documentation for more information.

Comment by Asya Kamsky [ 13/Dec/13 ]

It's not clear there is an analogous "utility/command" - disabling NUMA in BIOS is one option though in some scenarios on some variants of OS/machines it's not even possible there. There are ways to start processes to bind to one NUMA node. Windows API has SetThreadAffinityMask - but all the threads that might be working on shared memory must run on the same core...

Comment by Matt Kangas [ 13/Dec/13 ]

Note that on Linux, when you launch on a NUMA machine you will see:

$ ./mongod
2013-12-13T14:52:00.825-0500 [initandlisten] MongoDB starting : pid=9599 port=27017 dbpath=/data/db 64-bit host=beefsupreme
2013-12-13T14:52:00.825-0500 [initandlisten] _DEBUG build (which is slower)
2013-12-13T14:52:00.825-0500 [initandlisten]
2013-12-13T14:52:00.825-0500 [initandlisten] ** NOTE: This is a development version (2.5.5-pre-) of MongoDB.
2013-12-13T14:52:00.825-0500 [initandlisten] **       Not recommended for production.
2013-12-13T14:52:00.826-0500 [initandlisten]
2013-12-13T14:52:00.826-0500 [initandlisten] ** WARNING: You are running on a NUMA machine.
2013-12-13T14:52:00.826-0500 [initandlisten] **          We suggest launching mongod like this to avoid performance problems:
2013-12-13T14:52:00.826-0500 [initandlisten] **              numactl --interleave=all mongod [other options]
2013-12-13T14:52:00.826-0500 [initandlisten]
2013-12-13T14:52:00.826-0500 [initandlisten] db version v2.5.5-pre-

Then, relaunching with the recommended command, the warning goes away.

$ numactl --interleave=all ./mongod
./mongod --help for help and startup options
2013-12-13T14:53:05.470-0500 [initandlisten] MongoDB starting : pid=9625 port=27017 dbpath=/data/db 64-bit host=beefsupreme
2013-12-13T14:53:05.470-0500 [initandlisten] _DEBUG build (which is slower)
2013-12-13T14:53:05.470-0500 [initandlisten]
2013-12-13T14:53:05.470-0500 [initandlisten] ** NOTE: This is a development version (2.5.5-pre-) of MongoDB.
2013-12-13T14:53:05.470-0500 [initandlisten] **       Not recommended for production.
2013-12-13T14:53:05.471-0500 [initandlisten]
2013-12-13T14:53:05.471-0500 [initandlisten] db version v2.5.5-pre-

Let's make sure Windows works similarly.

Generated at Thu Feb 08 03:27:25 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.