diff options
author | ziadh@chromium.org <ziadh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-02 16:34:26 +0000 |
---|---|---|
committer | ziadh@chromium.org <ziadh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-02 16:34:26 +0000 |
commit | 78a258a24ae6d4b764b5616cc639367fb3a573b7 (patch) | |
tree | 87dbb4ae0e2465b29c4829961490274a8f8cd803 /chrome | |
parent | 695092fd7614c257866347f049e28ec327d7a3d3 (diff) | |
download | chromium_src-78a258a24ae6d4b764b5616cc639367fb3a573b7.zip chromium_src-78a258a24ae6d4b764b5616cc639367fb3a573b7.tar.gz chromium_src-78a258a24ae6d4b764b5616cc639367fb3a573b7.tar.bz2 |
A/B test for measuring effect of number of proxy connections.
Currently, we limit the number of connections per proxy server to 32 (raised
from 15). Firefox uses 8. A low value keeps from overloading the proxy servers;
at the same time, some users may hit the limit (since we use the same number
for both HTTP and SOCKS proxies). This experiment selects a different number at
browser launch (from the set [8, 16, 32, 64]), and attempts to look at certain
stats to get a clearer picture of how this affects the user.
BUG=44501
r=jar
Review URL: http://codereview.chromium.org/3033045
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54541 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/browser_main.cc | 42 | ||||
-rw-r--r-- | chrome/browser/browser_main.h | 3 | ||||
-rw-r--r-- | chrome/renderer/render_view.cc | 36 |
3 files changed, 80 insertions, 1 deletions
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc index 6f23885..81e78a7 100644 --- a/chrome/browser/browser_main.cc +++ b/chrome/browser/browser_main.cc @@ -163,6 +163,7 @@ void BrowserMainParts::EarlyInitialization() { ConnectionFieldTrial(); SocketTimeoutFieldTrial(); + ProxyConnectionsFieldTrial(); SpdyFieldTrial(); InitializeSSL(); @@ -260,6 +261,47 @@ void BrowserMainParts::SocketTimeoutFieldTrial() { } } +void BrowserMainParts::ProxyConnectionsFieldTrial() { + const FieldTrial::Probability kProxyConnectionsDivisor = 100; + // 25% probability + const FieldTrial::Probability kProxyConnectionProbability = 25; + + scoped_refptr<FieldTrial> proxy_connection_trial = + new FieldTrial("ProxyConnectionImpact", kProxyConnectionsDivisor); + + const int proxy_connections_8 = + proxy_connection_trial->AppendGroup("_proxy_connections_8", + kProxyConnectionProbability); + const int proxy_connections_16 = + proxy_connection_trial->AppendGroup("_proxy_connections_16", + kProxyConnectionProbability); + const int proxy_connections_64 = + proxy_connection_trial->AppendGroup("_proxy_connections_64", + kProxyConnectionProbability); + + // This (32 connections per proxy server) is the current default value. + // Declaring it here allows us to easily re-assign the probability space while + // maintaining that the default group always has the remainder of the "share", + // which allows for cleaner and quicker changes down the line if needed. + const int proxy_connections_32 = + proxy_connection_trial->AppendGroup("_proxy_connections_32", + FieldTrial::kAllRemainingProbability); + + const int proxy_connections_trial_group = proxy_connection_trial->group(); + + if (proxy_connections_trial_group == proxy_connections_8) { + net::HttpNetworkSession::set_max_sockets_per_proxy_server(8); + } else if (proxy_connections_trial_group == proxy_connections_16) { + net::HttpNetworkSession::set_max_sockets_per_proxy_server(16); + } else if (proxy_connections_trial_group == proxy_connections_32) { + net::HttpNetworkSession::set_max_sockets_per_proxy_server(32); + } else if (proxy_connections_trial_group == proxy_connections_64) { + net::HttpNetworkSession::set_max_sockets_per_proxy_server(64); + } else { + NOTREACHED(); + } +} + // When --use-spdy not set, users will be in A/B test for spdy. // group A (npn_with_spdy): this means npn and spdy are enabled. In case server // supports spdy, browser will use spdy. diff --git a/chrome/browser/browser_main.h b/chrome/browser/browser_main.h index f7a5a80..6ef2bbe 100644 --- a/chrome/browser/browser_main.h +++ b/chrome/browser/browser_main.h @@ -107,6 +107,9 @@ class BrowserMainParts { // A/B test for determining a value for unused socket timeout. void SocketTimeoutFieldTrial(); + // A/B test for the maximum number of connections per proxy server. + void ProxyConnectionsFieldTrial(); + // A/B test for spdy when --use-spdy not set. void SpdyFieldTrial(); diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc index 30339df..c2db5d5 100644 --- a/chrome/renderer/render_view.cc +++ b/chrome/renderer/render_view.cc @@ -4687,7 +4687,7 @@ void RenderView::DumpLoadHistograms() const { } } - + // Histograms to determine effect of idle socket timeout. static bool use_idle_socket_timeout_histogram( FieldTrialList::Find("IdleSktToImpact") && !FieldTrialList::Find("IdleSktToImpact")->group_name().empty()); @@ -4721,6 +4721,40 @@ void RenderView::DumpLoadHistograms() const { } } + // Histograms to determine effect of number of connections per proxy. + static bool use_proxy_connection_impact_histogram( + FieldTrialList::Find("ProxyConnectionImpact") && + !FieldTrialList::Find("ProxyConnectionImpact")->group_name().empty()); + if (use_proxy_connection_impact_histogram) { + UMA_HISTOGRAM_ENUMERATION( + FieldTrial::MakeName("PLT.Abandoned", "ProxyConnectionImpact"), + abandoned_page ? 1 : 0, 2); + switch (load_type) { + case NavigationState::NORMAL_LOAD: + PLT_HISTOGRAM(FieldTrial::MakeName( + "PLT.BeginToFinish_NormalLoad", "ProxyConnectionImpact"), + begin_to_finish); + break; + case NavigationState::LINK_LOAD_NORMAL: + PLT_HISTOGRAM(FieldTrial::MakeName( + "PLT.BeginToFinish_LinkLoadNormal", "ProxyConnectionImpact"), + begin_to_finish); + break; + case NavigationState::LINK_LOAD_RELOAD: + PLT_HISTOGRAM(FieldTrial::MakeName( + "PLT.BeginToFinish_LinkLoadReload", "ProxyConnectionImpact"), + begin_to_finish); + break; + case NavigationState::LINK_LOAD_CACHE_STALE_OK: + PLT_HISTOGRAM(FieldTrial::MakeName( + "PLT.BeginToFinish_LinkLoadStaleOk", "ProxyConnectionImpact"), + begin_to_finish); + break; + default: + break; + } + } + // Histograms to determine if SDCH has an impact. // TODO(jar): Consider removing per-link load types and the enumeration. static bool use_sdch_histogram(FieldTrialList::Find("GlobalSdch") && |