Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(614)

Issue 1808001: Implement a 15 connection per proxy server limit. (Closed)

Created:
10 years, 8 months ago by willchan no longer on Chromium
Modified:
9 years, 7 months ago
CC:
chromium-reviews
Base URL:
http://src.chromium.org/git/chromium.git
Visibility:
Public.

Description

Implement a 15 connection per proxy server limit. Previously, we had a limit of 6 connections per proxy server, which was horrifically low. Connections to all endpoint hosts remains at 6. Basically, we have a map of socket pools, keyed by the proxy server. Each of these proxy socket pools has a socket limit of 15 and a connection limit per host of 6. The main TCP socket pool (non-proxied) has the standard 256 socket limit, and connection limit per host of 6. There are two maps currently, one for HTTP proxies and one for SOCKS proxies. Note that SSL tunnels over HTTP CONNECTs are still located within the standard http proxy socket pools. We depend on the fact that our code never returns a non-SSL connected socket to the pool for a |connection_group| that is to a HTTPS endpoint. A newly connected socket from the pool will only have the TCP connection done. An idle socket will have both the TCP and the HTTP CONNECT and the SSL handshake done for it. TODO(willchan): Remove the extra constructor overload for the old deprecated parameters. Switch to using HostPortPair everywhere. TODO(willchan): Finish SSL socket pools. TODO(willchan): Rip out the DoInitConnection() code so it can be shared by other caller (TCP pre-warming!). TODO(willchan): Flush out the socket pool maps when the proxy configuration changes. TODO(willchan): Fix up global socket limits. They're slightly broken in this case, since each pool instance has its own "global" limit, so obviously different pools don't share the same "global" limit. This is such a minor deal since the global limits are so small for proxy servers compared to the system global limits (256 vs 15), that it doesn't have a big effect. TODO(willchan): Drink moar b33r. BUG=12066 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=45896

Patch Set 1 #

Total comments: 34

Patch Set 2 : Address comments. #

Patch Set 3 : Add more test coverage for proxy group names. #

Total comments: 7

Patch Set 4 : Merge #

Patch Set 5 : Address Steve's comments. #

Patch Set 6 : Rebase. #

Total comments: 4

Patch Set 7 : Remove extra newline. #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+396 lines, -171 lines) Patch
M net/base/host_port_pair.h View 1 chunk +4 lines, -3 lines 0 comments Download
M net/http/http_network_session.h View 1 2 4 chunks +23 lines, -21 lines 0 comments Download
M net/http/http_network_session.cc View 1 2 3 4 5 6 3 chunks +90 lines, -20 lines 1 comment Download
M net/http/http_network_transaction.h View 1 2 3 1 chunk +3 lines, -3 lines 0 comments Download
M net/http/http_network_transaction.cc View 1 2 3 3 chunks +52 lines, -45 lines 2 comments Download
M net/http/http_network_transaction_unittest.cc View 1 2 3 4 7 chunks +179 lines, -65 lines 0 comments Download
M net/proxy/proxy_server.h View 2 chunks +6 lines, -0 lines 0 comments Download
M net/proxy/proxy_server.cc View 1 chunk +7 lines, -0 lines 0 comments Download
M net/socket/socks_client_socket_pool.h View 2 chunks +3 lines, -2 lines 0 comments Download
M net/socket/socks_client_socket_pool_unittest.cc View 1 2 3 1 chunk +8 lines, -5 lines 0 comments Download
M net/socket/tcp_client_socket_pool.h View 3 chunks +16 lines, -3 lines 0 comments Download
M net/socket/tcp_client_socket_pool_unittest.cc View 1 2 3 2 chunks +3 lines, -2 lines 0 comments Download
M net/spdy/spdy_network_transaction.cc View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 14 (0 generated)
willchan no longer on Chromium
Not quite ready for review. But it's probably worth it to take a quick overview. ...
10 years, 8 months ago (2010-04-28 00:00:14 UTC) #1
vandebo (ex-Chrome)
Seems good. Not sure about all your TODO's Enforcing a global connection limit is probably ...
10 years, 8 months ago (2010-04-28 00:58:18 UTC) #2
willchan no longer on Chromium
On 2010/04/28 00:58:18, vandebo wrote: > Seems good. > > Not sure about all your ...
10 years, 8 months ago (2010-04-28 01:10:00 UTC) #3
vandebo (ex-Chrome)
Oops, forgot to include my comments... On Tue, Apr 27, 2010 at 6:10 PM, <willchan@chromium.org> ...
10 years, 8 months ago (2010-04-28 01:22:26 UTC) #4
eroman
Overall I like the increase of the HTTP proxy limit from 6 to 15 (you ...
10 years, 8 months ago (2010-04-28 01:34:00 UTC) #5
willchan no longer on Chromium
I agreed with the risk of breaking SOCKS if versions 4 and 5 were both ...
10 years, 8 months ago (2010-04-28 02:54:40 UTC) #6
eroman
> I am not sure how the HTTP tunneling is broken. Can you explain that? ...
10 years, 8 months ago (2010-04-28 03:14:29 UTC) #7
willchan no longer on Chromium
On 2010/04/28 03:14:29, eroman wrote: > > I am not sure how the HTTP tunneling ...
10 years, 8 months ago (2010-04-28 03:23:02 UTC) #8
vandebo (ex-Chrome)
LGTM with comments. http://codereview.chromium.org/1808001/diff/10002/15004 File net/http/http_network_transaction.cc (right): http://codereview.chromium.org/1808001/diff/10002/15004#newcode779 net/http/http_network_transaction.cc:779: StringPrintf("socks%s/%s", socks_version, connection_group.c_str()); Why not use ...
10 years, 8 months ago (2010-04-28 21:18:09 UTC) #9
willchan no longer on Chromium
Thanks for the review Steve. Eric, have anything else? Wan-Teh, want to take a look?? ...
10 years, 8 months ago (2010-04-28 21:49:53 UTC) #10
vandebo (ex-Chrome)
http://codereview.chromium.org/1808001/diff/10002/15004 File net/http/http_network_transaction.cc (right): http://codereview.chromium.org/1808001/diff/10002/15004#newcode779 net/http/http_network_transaction.cc:779: StringPrintf("socks%s/%s", socks_version, connection_group.c_str()); On 2010/04/28 21:49:54, willchan wrote: > ...
10 years, 8 months ago (2010-04-28 22:07:24 UTC) #11
eroman
lgtm http://codereview.chromium.org/1808001/diff/25001/26002 File net/http/http_network_session.cc (right): http://codereview.chromium.org/1808001/diff/25001/26002#newcode90 net/http/http_network_session.cc:90: nit: extra line http://codereview.chromium.org/1808001/diff/25001/26004 File net/http/http_network_transaction.cc (right): http://codereview.chromium.org/1808001/diff/25001/26004#newcode760 ...
10 years, 7 months ago (2010-04-29 00:45:36 UTC) #12
willchan no longer on Chromium
Skipping wtc's review and landing now. wtc, let me know if there's anything else you ...
10 years, 7 months ago (2010-04-29 01:03:50 UTC) #13
wtc
10 years, 7 months ago (2010-05-03 19:01:53 UTC) #14
Will,

Sorry about the late review.  I'm sure vandebo and eroman
have done a good review of your CL.

I reviewed the code and the CL's description that you asked
me to look at.  They look good to me.

The first half of HttpNetworkTransaction::DoInitConnection
becomes simpler, but the second half becomes more complicated
because of the SOCKS code.  I wonder if we can hide it in
a method of the ProxyServer class.  Feel free to ignore
this nit.

http://codereview.chromium.org/1808001/diff/23002/13003
File net/http/http_network_session.cc (right):

http://codereview.chromium.org/1808001/diff/23002/13003#newcode31
net/http/http_network_session.cc:31: int g_max_sockets_per_proxy_server = 15;
I would use 16, since 15 is so close to a power of 2.

http://codereview.chromium.org/1808001/diff/23002/13005
File net/http/http_network_transaction.cc (right):

http://codereview.chromium.org/1808001/diff/23002/13005#newcode749
net/http/http_network_transaction.cc:749: if (!proxy_info_.is_direct()) {
Nit: I prefer
    if (condition) {
      A;
    } else {
      B;
    }
over
    if (!condition) {
      B;
    } else {
      A;
    }

This is just a personal preference.

http://codereview.chromium.org/1808001/diff/23002/13005#newcode769
net/http/http_network_transaction.cc:769: StringPrintf("socks%s/%s",
socks_version, connection_group.c_str());
Should we also add a "http/" prefix to the connection_group
for normal (HTTP) proxies?

Powered by Google App Engine
This is Rietveld 408576698