mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Check file handle limit on startup (RIPD-442, RIPD-1024):
Calculate the number of file descriptors that are needed during execution based on the configuration file, with a hard floor of 1024, adjusting the limit if possible. Refuse to run if enough fds are not available. Additionally, allow administrators to limit the number of incoming connections a configured port will accept. By default no limit is imposed.
This commit is contained in:
@@ -221,6 +221,9 @@ SHAMapStoreImp::makeDatabase (std::string const& name,
|
||||
makeBackendRotating (state.writableDb));
|
||||
std::shared_ptr <NodeStore::Backend> archiveBackend (
|
||||
makeBackendRotating (state.archiveDb));
|
||||
|
||||
fdlimit_ = writableBackend->fdlimit() + archiveBackend->fdlimit();
|
||||
|
||||
std::unique_ptr <NodeStore::DatabaseRotating> dbr =
|
||||
makeDatabaseRotating (name, readThreads, writableBackend,
|
||||
archiveBackend);
|
||||
@@ -237,8 +240,9 @@ SHAMapStoreImp::makeDatabase (std::string const& name,
|
||||
}
|
||||
else
|
||||
{
|
||||
db = NodeStore::Manager::instance().make_Database (name, scheduler_, nodeStoreJournal_,
|
||||
readThreads, setup_.nodeDatabase);
|
||||
db = NodeStore::Manager::instance().make_Database (name, scheduler_,
|
||||
nodeStoreJournal_, readThreads, setup_.nodeDatabase);
|
||||
fdlimit_ = db->fdlimit();
|
||||
}
|
||||
|
||||
return db;
|
||||
@@ -269,6 +273,12 @@ SHAMapStoreImp::rendezvous() const
|
||||
});
|
||||
}
|
||||
|
||||
int
|
||||
SHAMapStoreImp::fdlimit () const
|
||||
{
|
||||
return fdlimit_;
|
||||
}
|
||||
|
||||
bool
|
||||
SHAMapStoreImp::copyNode (std::uint64_t& nodeCount,
|
||||
SHAMapAbstractNode const& node)
|
||||
|
||||
Reference in New Issue
Block a user