From c1d64e1b1a321c9a74eb72bb08fd805b3739d373 Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Tue, 9 May 2017 09:03:39 -0700 Subject: [PATCH] Overlay tuning and logging improvements: Adjust overlay tuning to reflect measured behavior of the network under increased load. Improve logging of peer sendq size and disconnect reasons. --- src/ripple/overlay/impl/PeerImp.cpp | 10 +++++++++- src/ripple/overlay/impl/Tuning.h | 13 ++++++++----- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/ripple/overlay/impl/PeerImp.cpp b/src/ripple/overlay/impl/PeerImp.cpp index 06a076a40c..765bf2d0b0 100644 --- a/src/ripple/overlay/impl/PeerImp.cpp +++ b/src/ripple/overlay/impl/PeerImp.cpp @@ -210,6 +210,12 @@ PeerImp::send (Message::pointer const& m) // a small senq periodically large_sendq_ = 0; } + else if ((sendq_size % Tuning::sendQueueLogFreq) == 0) + { + JLOG (journal_.debug()) << + (name_.empty() ? remote_address_.to_string() : name_) << + " sendq: " << sendq_size; + } send_queue_.push(m); @@ -442,7 +448,9 @@ PeerImp::fail(std::string const& reason) shared_from_this(), reason)); if (socket_.is_open()) { - JLOG (journal_.debug()) << reason; + JLOG (journal_.warn()) << + (name_.empty() ? remote_address_.to_string() : name_) << + " failed: " << reason; } close(); } diff --git a/src/ripple/overlay/impl/Tuning.h b/src/ripple/overlay/impl/Tuning.h index 76e1f1b7a3..566280fe39 100644 --- a/src/ripple/overlay/impl/Tuning.h +++ b/src/ripple/overlay/impl/Tuning.h @@ -52,13 +52,13 @@ enum /** How many milliseconds to consider high latency on a peer connection */ - peerHighLatency = 250, + peerHighLatency = 300, /** How often we check connections (seconds) */ - checkSeconds = 10, + checkSeconds = 32, /** How often we latency/sendq probe connections */ - timerSeconds = 4, + timerSeconds = 8, /** How many timer intervals a sendq has to stay large before we disconnect */ sendqIntervals = 4, @@ -67,10 +67,13 @@ enum noPing = 10, /** How many messages on a send queue before we refuse queries */ - dropSendQueue = 8, + dropSendQueue = 192, /** How many messages we consider reasonable sustained on a send queue */ - targetSendQueue = 16, + targetSendQueue = 128, + + /** How often to log send queue size */ + sendQueueLogFreq = 64, }; } // Tuning