[squid-dev] [PATCH] Make Squid death due to overloaded helpers optional

Eduard Bagdasaryan eduard.bagdasaryan at measurement-factory.com
Mon Aug 8 15:14:59 UTC 2016


This patch allows to configure Squid so that it reject overloaded helper
requests instead of [default] crashing.

Added on-persistent-overload=action option to helpers. Helper overload
is defined as running with an overflowing queue. Persistent helper
overload is [still] defined as being overloaded for more than 3 minutes.

The default behavior is unchanged(*) -- Squid worker dies with a fatal
error at the attempt to submit a new request to a persistenly overloaded
helper. This default behavior can also be configured explicitly using
on-persistent-overload=die.

With on-persistent-overload=err, when dealing with a persistently
overloaded helper, Squid immediately drops the helper request and sends
an empty response to the caller which should handle that empty response
as an error. Squid informs the admin when it starts and when it stops
dropping helper requests due to persistent overload.

The code had conflicting notions of an "overloaded helper". The external
ACL helper, the URL rewriter, and the store ID code used queueFull() to
test whether the new request would overflow the queue (and, hence,
overload the helper), but queueFull() itself did not check whether the
queue was full! It checked whether the queue was already overflowing.
This confusion resulted in that code scheduling one extra helper request
before enabling bypass. The code and its documentation are now more
consistent (and better match the "overload" terminology used by the new
configuration option, which also feels better than calling the helper
"full").

(*) Resolving the above confusion resulted in minor (one request)
differences in the number of helper requests queued by Squid for
external ACL, URL rewriting, and store ID helpers, with the adjusted
behavior [better] matching the documentation.

Regards,
Eduard.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SQUID-30-reject-helper-requests-on-overload-t10.patch
Type: text/x-patch
Size: 52989 bytes
Desc: not available
URL: <http://lists.squid-cache.org/pipermail/squid-dev/attachments/20160808/2b5541e7/attachment-0001.bin>


More information about the squid-dev mailing list