diff options
author | Adam Midvidy <amidvidy@gmail.com> | 2014-07-24 17:04:47 -0400 |
---|---|---|
committer | Ramon Fernandez <ramon@mongodb.com> | 2015-02-09 14:15:17 -0500 |
commit | af299df741f0b0102fd9005cdfd066693aec6f16 (patch) | |
tree | 768eba31f20693b83bfdf7ae8e505083f3b56fa1 | |
parent | 0de9b597c0dba9401fbcd2dfbe8f51bb55ce3241 (diff) | |
download | mongo-af299df741f0b0102fd9005cdfd066693aec6f16.tar.gz |
SERVER-14572 Increase C runtime stdio file limit
Signed-off-by: Mark Benvenuto <mark.benvenuto@mongodb.com>
(cherry picked from commit 396380291e600f9d72d2e405f7b7cb4e8b7d4811)
-rw-r--r-- | src/mongo/util/platform_init.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mongo/util/platform_init.cpp b/src/mongo/util/platform_init.cpp index d284a6aa3ee..ae107fcddbb 100644 --- a/src/mongo/util/platform_init.cpp +++ b/src/mongo/util/platform_init.cpp @@ -29,9 +29,11 @@ #ifdef _WIN32 #include <crtdbg.h> #include <stdlib.h> +#include <stdio.h> #endif #include "mongo/base/init.h" +#include "mongo/util/log.h" #include "mongo/util/stacktrace.h" #ifdef _WIN32 @@ -46,6 +48,10 @@ namespace mongo { // hook the C runtime's error display _CrtSetReportHook(crtDebugCallback); + if (_setmaxstdio(2048) == -1) { + warning() << "Failed to increase max open files limit from default of 512 to 2048"; + } + return Status::OK(); } |