diff options
Diffstat (limited to 'src/mongo/util/processinfo.h')
-rw-r--r-- | src/mongo/util/processinfo.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/mongo/util/processinfo.h b/src/mongo/util/processinfo.h index 408e633bd9b..4752b6d2e62 100644 --- a/src/mongo/util/processinfo.h +++ b/src/mongo/util/processinfo.h @@ -101,13 +101,20 @@ public: } /** - * Get the number of CPUs + * Get the number of (logical) CPUs */ static unsigned getNumCores() { return sysInfo().numCores; } /** + * Get the number of physical CPUs + */ + static unsigned getNumPhysicalCores() { + return sysInfo().numPhysicalCores; + } + + /** * Get the number of cores available. Make a best effort to get the cores for this process. * If that information is not available, get the total number of CPUs. */ @@ -208,6 +215,7 @@ private: unsigned long long memSize; unsigned long long memLimit; unsigned numCores; + unsigned numPhysicalCores; unsigned long long pageSize; std::string cpuArch; bool hasNuma; @@ -230,6 +238,7 @@ private: memSize(0), memLimit(0), numCores(0), + numPhysicalCores(0), pageSize(0), hasNuma(false), fileZeroNeeded(false), |