Re: Multiple issues in Squid-3.2.3 SMP + rock + aufs + a bit of load

From: Henrik Nordström <henrik_at_henriknordstrom.net>
Date: Mon, 03 Dec 2012 02:46:09 +0100

fre 2012-11-30 klockan 15:38 -0700 skrev Alex Rousskov:
> On 11/30/2012 02:25 PM, Henrik Nordström wrote:
>
> > We should look into why it is at all needed. From what I can understand
> > it should not be needed.
>
> Agreed. Please do that if you can.

Found it. The event loop gets saturated with timed events during the
rebuild and never exectues comm events. There is a little premature
optimization there skipping the primary engine while checking all
others, causing comm to starve to death.

Fixed by this change. I think it's correct but review please.

diff -ru squid-3.2.3/src/EventLoop.cc squid-3.2.3-dpl/src/EventLoop.cc
--- squid-3.2.3/src/EventLoop.cc 2012-10-20 15:39:49.000000000
+0300
+++ squid-3.2.3-dpl/src/EventLoop.cc 2012-12-03 01:52:25.381523614
+0200
@@ -111,7 +111,6 @@
         // generate calls and events
         typedef engine_vector::iterator EVI;
         for (EVI i = engines.begin(); i != engines.end(); ++i) {
- if (*i != waitingEngine)
- checkEngine(*i, false);
+ checkEngine(*i, false);
         }

With this
 * original timeouts works fine
 * rebuild is now done in background as expected

Unfortunately it uncovered another minor bug resulting in 100% CPU
usage. Fixed by this:

diff -ru --exclude helpers --exclude tools squid-3.2.3/src/comm.cc
squid-3.2.3-dpl/src/comm.cc
--- squid-3.2.3/src/comm.cc 2012-10-20 15:39:49.000000000 +0300
+++ squid-3.2.3-dpl/src/comm.cc 2012-12-03 02:59:34.713503938 +0200
@@ -2071,7 +2071,7 @@
     case COMM_OK:

     case COMM_TIMEOUT:
- return 0;
+ return EVENT_IDLE;

     case COMM_IDLE:

Also in testing this I observed that fast ACLs do not do inverse of last
rule on no match. Excplicit allow/deny all rule is needed. Don't think
this is intentional.

Regards
Henrik
Received on Mon Dec 03 2012 - 01:46:15 MST

This archive was generated by hypermail 2.2.0 : Mon Dec 03 2012 - 12:00:06 MST