mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-25 13:35:54 +00:00
Give ledger data requests their own job type:
This gives requests for ledger data (and transaction set data) from peers a separate job type and prioritizes it appropriately. Previously it was lumped in with fetch packs which have a low concurrency limit. This should improve the performance of retrieving historical information.
This commit is contained in:
@@ -40,8 +40,8 @@ enum JobType
|
|||||||
jtPACK, // Make a fetch pack for a peer
|
jtPACK, // Make a fetch pack for a peer
|
||||||
jtPUBOLDLEDGER, // An old ledger has been accepted
|
jtPUBOLDLEDGER, // An old ledger has been accepted
|
||||||
jtVALIDATION_ut, // A validation from an untrusted source
|
jtVALIDATION_ut, // A validation from an untrusted source
|
||||||
jtPROOFWORK, // A proof of work demand from another server
|
|
||||||
jtTRANSACTION_l, // A local transaction
|
jtTRANSACTION_l, // A local transaction
|
||||||
|
jtLEDGER_REQ, // Peer request ledger/txnset data
|
||||||
jtPROPOSAL_ut, // A proposal from an untrusted source
|
jtPROPOSAL_ut, // A proposal from an untrusted source
|
||||||
jtLEDGER_DATA, // Received data for a ledger we're acquiring
|
jtLEDGER_DATA, // Received data for a ledger we're acquiring
|
||||||
jtCLIENT, // A websocket command from the client
|
jtCLIENT, // A websocket command from the client
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ public:
|
|||||||
typedef std::map <JobType, JobTypeInfo> Map;
|
typedef std::map <JobType, JobTypeInfo> Map;
|
||||||
typedef Map::const_iterator const_iterator;
|
typedef Map::const_iterator const_iterator;
|
||||||
|
|
||||||
|
|
||||||
JobTypes ()
|
JobTypes ()
|
||||||
: m_unknown (jtINVALID, "invalid", 0, true, true, 0, 0)
|
: m_unknown (jtINVALID, "invalid", 0, true, true, 0, 0)
|
||||||
{
|
{
|
||||||
@@ -51,14 +50,14 @@ public:
|
|||||||
add (jtVALIDATION_ut, "untrustedValidation",
|
add (jtVALIDATION_ut, "untrustedValidation",
|
||||||
maxLimit, true, false, 2000, 5000);
|
maxLimit, true, false, 2000, 5000);
|
||||||
|
|
||||||
// A proof of work demand from another server
|
|
||||||
add (jtPROOFWORK, "proofOfWork",
|
|
||||||
maxLimit, true, false, 2000, 5000);
|
|
||||||
|
|
||||||
// A local transaction
|
// A local transaction
|
||||||
add (jtTRANSACTION_l, "localTransaction",
|
add (jtTRANSACTION_l, "localTransaction",
|
||||||
maxLimit, true, false, 100, 500);
|
maxLimit, true, false, 100, 500);
|
||||||
|
|
||||||
|
// A request for ledger/txnset data from another server
|
||||||
|
add (jtLEDGER_REQ, "ledgerRequest",
|
||||||
|
2, true, false, 0, 0);
|
||||||
|
|
||||||
// A proposal from an untrusted source
|
// A proposal from an untrusted source
|
||||||
add (jtPROPOSAL_ut, "untrustedProposal",
|
add (jtPROPOSAL_ut, "untrustedProposal",
|
||||||
maxLimit, true, false, 500, 1250);
|
maxLimit, true, false, 500, 1250);
|
||||||
@@ -67,10 +66,6 @@ public:
|
|||||||
add (jtLEDGER_DATA, "ledgerData",
|
add (jtLEDGER_DATA, "ledgerData",
|
||||||
2, true, false, 0, 0);
|
2, true, false, 0, 0);
|
||||||
|
|
||||||
// Update pathfinding requests
|
|
||||||
add (jtUPDATE_PF, "updatePaths",
|
|
||||||
maxLimit, true, false, 0, 0);
|
|
||||||
|
|
||||||
// A websocket command from the client
|
// A websocket command from the client
|
||||||
add (jtCLIENT, "clientCommand",
|
add (jtCLIENT, "clientCommand",
|
||||||
maxLimit, true, false, 2000, 5000);
|
maxLimit, true, false, 2000, 5000);
|
||||||
@@ -79,6 +74,10 @@ public:
|
|||||||
add (jtRPC, "RPC",
|
add (jtRPC, "RPC",
|
||||||
maxLimit, false, false, 0, 0);
|
maxLimit, false, false, 0, 0);
|
||||||
|
|
||||||
|
// Update pathfinding requests
|
||||||
|
add (jtUPDATE_PF, "updatePaths",
|
||||||
|
maxLimit, true, false, 0, 0);
|
||||||
|
|
||||||
// A transaction received from the network
|
// A transaction received from the network
|
||||||
add (jtTRANSACTION, "transaction",
|
add (jtTRANSACTION, "transaction",
|
||||||
maxLimit, true, false, 250, 1000);
|
maxLimit, true, false, 250, 1000);
|
||||||
|
|||||||
@@ -943,7 +943,7 @@ void
|
|||||||
PeerImp::onMessage (std::shared_ptr <protocol::TMGetLedger> const& m)
|
PeerImp::onMessage (std::shared_ptr <protocol::TMGetLedger> const& m)
|
||||||
{
|
{
|
||||||
fee_ = Resource::feeMediumBurdenPeer;
|
fee_ = Resource::feeMediumBurdenPeer;
|
||||||
getApp().getJobQueue().addJob (jtPACK, "recvGetLedger", std::bind(
|
getApp().getJobQueue().addJob (jtLEDGER_REQ, "recvGetLedger", std::bind(
|
||||||
beast::weak_fn(&PeerImp::getLedger, shared_from_this()), m));
|
beast::weak_fn(&PeerImp::getLedger, shared_from_this()), m));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user