------------------------------------------------------------ revno: 11788 revision-id: squid3@treenet.co.nz-20130301105807-0z7ak6yyybfsz5l3 parent: squid3@treenet.co.nz-20130301104954-mt8dipvg5qlurfsr fixes bug(s): http://bugs.squid-cache.org/show_bug.cgi?id=3753 committer: Amos Jeffries branch nick: 3.2 timestamp: Fri 2013-03-01 03:58:07 -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-20130301105807-0z7ak6yyybfsz5l3 # target_branch: http://bzr.squid-cache.org/bzr/squid3/branches\ # /SQUID_3_2 # testament_sha1: 0036eba403d9a564b7ff62dd4bc65626f5c41730 # timestamp: 2013-03-01 11:06:32 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/branches\ # /SQUID_3_2 # base_revision_id: squid3@treenet.co.nz-20130301104954-\ # mt8dipvg5qlurfsr # # Begin patch === modified file 'src/forward.cc' --- src/forward.cc 2013-02-09 07:05:40 +0000 +++ src/forward.cc 2013-03-01 10:58:07 +0000 @@ -919,12 +919,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. @@ -989,7 +986,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); } @@ -1229,7 +1227,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 2012-11-30 13:38:38 +0000 +++ src/http.cc 2013-03-01 10:58:07 +0000 @@ -1449,7 +1449,7 @@ request->clientConnectionManager->pinConnection(serverConnection, request, _peer, (request->flags.connection_auth != 0)); } else { - fwd->pconnPush(serverConnection, request->peer_host ? request->peer_host : request->GetHost()); + fwd->pconnPush(serverConnection, request->GetHost()); } serverConnection = NULL;