summaryrefslogtreecommitdiff
path: root/util/version.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'util/version.cpp')
-rw-r--r--util/version.cpp42
1 files changed, 41 insertions, 1 deletions
diff --git a/util/version.cpp b/util/version.cpp
index f57e256..78a31be 100644
--- a/util/version.cpp
+++ b/util/version.cpp
@@ -23,10 +23,11 @@
#include <string>
#include "unittest.h"
#include "version.h"
+#include "file.h"
namespace mongo {
- const char versionString[] = "1.8.1";
+ const char versionString[] = "1.8.2";
string mongodVersion() {
stringstream ss;
@@ -94,6 +95,45 @@ namespace mongo {
cout << "** WARNING: You are running in OpenVZ. This is known to be broken!!!" << endl;
warned = true;
}
+
+ if (boost::filesystem::exists("/sys/devices/system/node/node1")){
+ // We are on a box with a NUMA enabled kernel and more than 1 numa node (they start at node0)
+ // Now we look at the first line of /proc/self/numa_maps
+ //
+ // Bad example:
+ // $ cat /proc/self/numa_maps
+ // 00400000 default file=/bin/cat mapped=6 N4=6
+ //
+ // Good example:
+ // $ numactl --interleave=all cat /proc/self/numa_maps
+ // 00400000 interleave:0-7 file=/bin/cat mapped=6 N4=6
+
+ File f;
+ f.open("/proc/self/numa_maps", /*read_only*/true);
+ if ( f.is_open() && ! f.bad() ) {
+ char line[100]; //we only need the first line
+ f.read(0, line, sizeof(line));
+
+ // just in case...
+ line[98] = ' ';
+ line[99] = '\0';
+
+ // skip over pointer
+ const char* space = strchr(line, ' ');
+
+ if ( ! space ) {
+ cout << "** WARNING: cannot parse numa_maps" << endl;
+ warned = true;
+ }
+ else if ( ! startsWith(space+1, "interleave") ) {
+ cout << endl;
+ cout << "** WARNING: You are running on a NUMA machine." << endl;
+ cout << "** We suggest launching mongod like this to avoid performance problems:" << endl;
+ cout << "** numactl --interleave=all mongod [other options]" << endl;
+ warned = true;
+ }
+ }
+ }
#endif
if (warned)