mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 09:32:32 +01:00
Warn on startup if using journaling and overcommit_memory is disabled SERVER-3489
This commit is contained in:
parent
02c6910265
commit
4f8df957c4
@ -27,6 +27,7 @@
|
||||
#include "../db/jsobj.h"
|
||||
#include "file.h"
|
||||
#include "ramlog.h"
|
||||
#include "../db/cmdline.h"
|
||||
|
||||
namespace mongo {
|
||||
|
||||
@ -190,6 +191,18 @@ namespace mongo {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (cmdLine.dur){
|
||||
fstream f ("/proc/sys/vm/overcommit_memory", ios_base::in);
|
||||
unsigned val;
|
||||
f >> val;
|
||||
|
||||
if (val == 2) {
|
||||
log() << startupWarningsLog;
|
||||
log() << "** WARNING: /proc/sys/vm/overcommit_memory is " << val << startupWarningsLog;
|
||||
log() << "** Journaling works best with it set to 0 or 1" << startupWarningsLog;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (warned) {
|
||||
|
Loading…
Reference in New Issue
Block a user