From e0410a0172b428b6cfa5baaf9b95f9107a9f7571 Mon Sep 17 00:00:00 2001 From: Michael Goulish Date: Fri, 29 Jan 2010 18:53:28 +0000 Subject: Change the heuristic used to alter the send estimate up and down. Especially, change the starting estimate to be much higher than 1 message. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@904588 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/src/qpid/cluster/OutputInterceptor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'qpid/cpp/src') diff --git a/qpid/cpp/src/qpid/cluster/OutputInterceptor.cpp b/qpid/cpp/src/qpid/cluster/OutputInterceptor.cpp index cb75fe5561..f80eb9c434 100644 --- a/qpid/cpp/src/qpid/cluster/OutputInterceptor.cpp +++ b/qpid/cpp/src/qpid/cluster/OutputInterceptor.cpp @@ -36,7 +36,7 @@ using namespace std; NoOpConnectionOutputHandler OutputInterceptor::discardHandler; OutputInterceptor::OutputInterceptor(Connection& p, sys::ConnectionOutputHandler& h) - : parent(p), closing(false), next(&h), sendMax(1), sent(0), sentDoOutput(false) + : parent(p), closing(false), next(&h), sendMax(2048), sent(0), sentDoOutput(false) {} void OutputInterceptor::send(framing::AMQFrame& f) { @@ -80,7 +80,7 @@ void OutputInterceptor::deliverDoOutput(uint32_t limit) { if (buffered == 0 && sent == sendMax) // Could have sent more, increase the limit. newLimit = sendMax*2; else if (buffered > 0 && sent > 1) // Data left unsent, reduce the limit. - newLimit = sent-1; + newLimit = (sendMax + sent) / 2; } sent = 0; while (sent < limit && parent.getBrokerConnection().doOutput()) -- cgit v1.2.1