summaryrefslogtreecommitdiff
path: root/src/mongo/util/processinfo.h
diff options
context:
space:
mode:
authorMark Benvenuto <mark.benvenuto@mongodb.com>2014-08-12 11:16:25 -0400
committerMark Benvenuto <mark.benvenuto@mongodb.com>2014-08-29 13:49:08 -0400
commitb983d2b0858507009c1ef1589853cf9aec8dba33 (patch)
tree3cc407c33a861171cf1141062c4a0c6b42898958 /src/mongo/util/processinfo.h
parenteca928dd6fdbca3b5a4e773af8f48333fee39409 (diff)
downloadmongo-b983d2b0858507009c1ef1589853cf9aec8dba33.tar.gz
SERVER-14129: Use fsync instead of msync for Solaris
Diffstat (limited to 'src/mongo/util/processinfo.h')
-rw-r--r--src/mongo/util/processinfo.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/mongo/util/processinfo.h b/src/mongo/util/processinfo.h
index d41b085a6eb..d415bf2eea7 100644
--- a/src/mongo/util/processinfo.h
+++ b/src/mongo/util/processinfo.h
@@ -103,6 +103,11 @@ namespace mongo {
static bool isDataFileZeroingNeeded() { return systemInfo->fileZeroNeeded; }
/**
+ * Determine if we need to workaround slow msync performance on Illumos/Solaris
+ */
+ static bool preferMsyncOverFSync() { return systemInfo->preferMsyncOverFSync; }
+
+ /**
* Get extra system stats
*/
void appendSystemDetails( BSONObjBuilder& details ) const {
@@ -162,13 +167,21 @@ namespace mongo {
//
bool fileZeroNeeded;
+ // On non-Solaris (ie, Linux, Darwin, *BSD) kernels, prefer msync.
+ // Illumos kernels do O(N) scans in memory of the page table during msync which
+ // causes high CPU, Oracle Solaris 11.2 and later modified ZFS to workaround mongodb
+ // Oracle Solaris Bug:
+ // 18658199 Speed up msync() on ZFS by 90000x with this one weird trick
+ bool preferMsyncOverFSync;
+
SystemInfo() :
addrSize( 0 ),
memSize( 0 ),
numCores( 0 ),
pageSize( 0 ),
hasNuma( false ),
- fileZeroNeeded (false) {
+ fileZeroNeeded (false),
+ preferMsyncOverFSync (true) {
// populate SystemInfo during construction
collectSystemInfo();
}