]> git.ipfire.org Git - thirdparty/squid.git/commit
Account for max-swap-rate in swap-timeout handling for Rock.
authorAlex Rousskov <rousskov@measurement-factory.com>
Fri, 14 Oct 2011 16:00:08 +0000 (10:00 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Fri, 14 Oct 2011 16:00:08 +0000 (10:00 -0600)
commit55939a017eefbe9df6f225395000cbc106d9854f
tree649552932bd3fdd9287bfc9d87dee1f7f68dcbf0
parent9bb016119a1ac45a31f638fd275a0adf8b2fc844
Account for max-swap-rate in swap-timeout handling for Rock.

Current swap-timeout code does not know about max-swap-rate.  It
simply finds the longest-waiting I/O in disker queues (incoming and
outgoing) and then assumes that the new I/O will wait at least that
long.  The assumption is likely to be wrong when the queue contains
lots of freshly queued requests to disker: Those requests have not
waited long yet, but a max-swap-rate limit will slow them down
shortly.

The patch changes the swap-timeout code to account for max-swap-rate
when dealing with the workers-to-disker queue: If there are N requests
pending, the new one will wait at least N/max-swap-rate seconds.  Also
expected wait time is adjusted based on the queue "balance" member, in
case we have been borrowing time against future I/O already.
src/DiskIO/IpcIo/IpcIoFile.cc
src/ipc/Queue.cc
src/ipc/Queue.h