mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Raise the current file descriptor limit to the maximum.
This commit is contained in:
@@ -17,6 +17,10 @@
|
||||
// This must come first to work around the boost placeholders issues
|
||||
#include "beast/modules/beast_basics/beast_basics.h"
|
||||
|
||||
#if BEAST_LINUX || BEAST_MAC || BEAST_BSD
|
||||
#include <sys/resource.h>
|
||||
#endif
|
||||
|
||||
// VFALCO NOTE Holy smokes...that's a lot of boost!!!
|
||||
#include <boost/algorithm/string.hpp>
|
||||
#include <boost/algorithm/string/predicate.hpp>
|
||||
|
||||
@@ -8,6 +8,18 @@ namespace po = boost::program_options;
|
||||
|
||||
void setupServer ()
|
||||
{
|
||||
#ifdef RLIMIT_NOFILE
|
||||
struct rlimit rl;
|
||||
if (getrlimit(RLIMIT_NOFILE, &rl) == 0)
|
||||
{
|
||||
if (rl.rlim_cur != rl.rlim_max)
|
||||
{
|
||||
rl.rlim_cur = rl.rlim_max;
|
||||
setrlimit(RLIMIT_NOFILE, &r1);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
getApp().setup ();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user