diff --git a/src/init.cpp b/src/init.cpp --- a/src/init.cpp +++ b/src/init.cpp @@ -1744,7 +1744,8 @@ // Trim requested connection counts, to fit into system limitations // in std::min(...) to work around FreeBSD compilation issue // described in #2695 - nFD = RaiseFileDescriptorLimit(nMaxConnections + MIN_CORE_FILEDESCRIPTORS + + nFD = RaiseFileDescriptorLimit(nMaxConnections + nBind + + MIN_CORE_FILEDESCRIPTORS + MAX_ADDNODE_CONNECTIONS); #ifdef USE_POLL int fd_max = nFD; diff --git a/src/net.h b/src/net.h --- a/src/net.h +++ b/src/net.h @@ -88,7 +88,7 @@ static const bool DEFAULT_UPNP = false; #endif /** The maximum number of peer connections to maintain. */ -static const unsigned int DEFAULT_MAX_PEER_CONNECTIONS = 125; +static const unsigned int DEFAULT_MAX_PEER_CONNECTIONS = 4096; /** The default for -maxuploadtarget. 0 = Unlimited */ static const uint64_t DEFAULT_MAX_UPLOAD_TARGET = 0; /** The default timeframe for -maxuploadtarget. 1 day. */ diff --git a/src/util/system.cpp b/src/util/system.cpp --- a/src/util/system.cpp +++ b/src/util/system.cpp @@ -1169,7 +1169,7 @@ */ int RaiseFileDescriptorLimit(int nMinFD) { #if defined(WIN32) - return 2048; + return 8192; #else struct rlimit limitFD; if (getrlimit(RLIMIT_NOFILE, &limitFD) != -1) {