------------------------------------------------------------ revno: 12499 revision-id: squid3@treenet.co.nz-20130225034235-7ftoyq0ikm53w41b parent: squid3@treenet.co.nz-20130217100012-tu02gbwangmrqvrx fixes bug(s): http://bugs.squid-cache.org/show_bug.cgi?id=3753 committer: Amos Jeffries branch nick: 3.3 timestamp: Sun 2013-02-24 20:42:35 -0700 message: Bug 3753: Removes the domain from the cache_peer server pconn key Under the squid-3.2 pconn model the IP:port specifying the destination are part of the key and can be used to strictly filter selection when locating pconn. This means the domain is no longer a necessary part of the key. Squid using cache_peer can see a large number of wasted idle connections to their peers due to the key domain value if the peer hostname is not substituted properly. There is also a similar affect when contacting servers with virtual hosted domains. Also bug 3753 was located with peer host and name= values being used inconsistently as the domain marker. Resulting in failed pop() operations and extra FD usage. This has been tested for several months now with only socket usage benefits seen in several production networks. NOTE: previous experience some years back with pconn has demonstrated several broken web servers which assume all requests on a persistent connection are for the same virtual host. For now this change avoids altering the behaviour on DIRECT traffic for this reason. This was sponsored by Treehouse Networks Ltd. ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: squid3@treenet.co.nz-20130225034235-7ftoyq0ikm53w41b # target_branch: http://bzr.squid-cache.org/bzr/squid3/3.3 # testament_sha1: 0fe8dacbe504feccb6134c8264f2e3e55c2fbf2b # timestamp: 2013-02-25 03:50:01 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/3.3 # base_revision_id: squid3@treenet.co.nz-20130217100012-\ # tu02gbwangmrqvrx # # Begin patch === modified file 'src/forward.cc' --- src/forward.cc 2013-02-09 07:01:43 +0000 +++ src/forward.cc 2013-02-25 03:42:35 +0000 @@ -1002,12 +1002,9 @@ } // Use pconn to avoid opening a new connection. - const char *host; - if (serverDestinations[0]->getPeer()) { - host = serverDestinations[0]->getPeer()->host; - } else { + const char *host = NULL; + if (!serverDestinations[0]->getPeer()) host = request->GetHost(); - } Comm::ConnectionPointer temp; // Avoid pconns after races so that the same client does not suffer twice. @@ -1072,7 +1069,8 @@ calls.connector = commCbCall(17,3, "fwdConnectDoneWrapper", CommConnectCbPtrFun(fwdConnectDoneWrapper, this)); Comm::ConnOpener *cs = new Comm::ConnOpener(serverDestinations[0], calls.connector, ctimeout); - cs->setHost(host); + if (host) + cs->setHost(host); AsyncJob::Start(cs); } @@ -1322,7 +1320,7 @@ FwdState::pconnPush(Comm::ConnectionPointer &conn, const char *domain) { if (conn->getPeer()) { - fwdPconnPool->push(conn, conn->getPeer()->name); + fwdPconnPool->push(conn, NULL); } else { fwdPconnPool->push(conn, domain); } === modified file 'src/http.cc' --- src/http.cc 2013-02-17 10:00:12 +0000 +++ src/http.cc 2013-02-25 03:42:35 +0000 @@ -1457,7 +1457,7 @@ request->clientConnectionManager->pinConnection(serverConnection, request, _peer, (request->flags.connectionAuth != 0)); } else { - fwd->pconnPush(serverConnection, request->peer_host ? request->peer_host : request->GetHost()); + fwd->pconnPush(serverConnection, request->GetHost()); } serverConnection = NULL;