diff options
| author | Alan Conway <aconway@apache.org> | 2014-06-26 04:34:12 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2014-06-26 04:34:12 +0000 |
| commit | 145c4767ac3d576ce8fdc4bdef4a67c671061090 (patch) | |
| tree | 17ce91bb643776522d1587bb737ac4a529306571 /qpid/cpp/src | |
| parent | 97aa3f4d5f5b22616d23fcba303d34932c5a68cb (diff) | |
| download | qpid-python-145c4767ac3d576ce8fdc4bdef4a67c671061090.tar.gz | |
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%.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1605664 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src')
| -rw-r--r-- | qpid/cpp/src/qpid/sys/posix/AsynchIO.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/qpid/cpp/src/qpid/sys/posix/AsynchIO.cpp b/qpid/cpp/src/qpid/sys/posix/AsynchIO.cpp index c609e1ed31..7418c93150 100644 --- a/qpid/cpp/src/qpid/sys/posix/AsynchIO.cpp +++ b/qpid/cpp/src/qpid/sys/posix/AsynchIO.cpp @@ -443,7 +443,6 @@ void AsynchIO::readable(DispatchHandle& h) { 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& h) { 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& h) { 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); |
