Author: aconway
Date: Thu Jun 26 04:34:12 2014
New Revision: 1605664
URL: http://svn.apache.org/r1605664
Log:
QPID-5843: Producing to many queues locks I/O threads for new connections
This patch changes where the duration is calculated in
sys/posix/AsyncIO.cpp->readable(). This will prevent the loop from executing
past the threadMaxIoTimeNs. Doing this decreased the connection delay observed
by 19%.
Modified:
qpid/trunk/qpid/cpp/src/qpid/sys/posix/AsynchIO.cpp
Modified: qpid/trunk/qpid/cpp/src/qpid/sys/posix/AsynchIO.cpp
URL:
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/sys/posix/AsynchIO.cpp?rev=1605664&r1=1605663&r2=1605664&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/sys/posix/AsynchIO.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/sys/posix/AsynchIO.cpp Thu Jun 26 04:34:12 2014
@@ -443,7 +443,6 @@ void AsynchIO::readable(DispatchHandle&
errno = 0;
int readCount = buff->byteCount-buff->dataCount;
int rc = socket.read(buff->bytes + buff->dataCount, readCount);
- int64_t duration = Duration(readStartTime, AbsTime::now());
++readCalls;
if (rc > 0) {
buff->dataCount += rc;
@@ -451,6 +450,7 @@ void AsynchIO::readable(DispatchHandle&
total += rc;
readCallback(*this, buff);
+ int64_t duration = Duration(readStartTime, AbsTime::now());
if (rc != readCount) {
// If we didn't fill the read buffer then time to stop
reading
QPID_PROBE4(asynchio_read_finished_done, &h, duration,
total, readCalls);
@@ -468,7 +468,7 @@ void AsynchIO::readable(DispatchHandle&
bufferQueue.push_front(buff);
assert(buff);
- QPID_PROBE5(asynchio_read_finished_error, &h, duration, total,
readCalls, errno);
+ QPID_PROBE5(asynchio_read_finished_error, &h,
Duration(readStartTime, AbsTime::now()), total, readCalls, errno);
// Eof or other side has gone away
if (rc == 0 || errno == ECONNRESET) {
eofCallback(*this);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]