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

Unified Diff: chrome/browser/browser_main.cc

Issue 2658006: Experiment for number of persistent connections to server... Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/renderer/render_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser_main.cc
===================================================================
--- chrome/browser/browser_main.cc (revision 49024)
+++ chrome/browser/browser_main.cc (working copy)
@@ -715,6 +715,41 @@
// Initialize statistical testing infrastructure for entire browser.
FieldTrialList field_trial;
+ // This is an A/B test for the maximum number of persistent connections per
+ // host. Currently Chrome, Firefox, and IE8 have this value set at 6.
+ // Safari uses 4, and Fasterfox (a plugin for Firefox that supposedly
+ // configures it to run faster) uses 8. We would like to see how much of an
+ // effect this value has on browsing. Too large a value might cause us to
+ // run into SYN flood detection mechanisms.
+ const FieldTrial::Probability kConnDivisor = 100;
+ const FieldTrial::Probability kConn16 = 10; // 10% probability
+ const FieldTrial::Probability kRemainingConn = 30; // 30% probability
+
+ scoped_refptr<FieldTrial> conn_trial =
+ new FieldTrial("ConnCountImpact", kConnDivisor);
+
+ const int conn_16 = conn_trial->AppendGroup("_conn_count_16", kConn16);
+ const int conn_4 = conn_trial->AppendGroup("_conn_count_4", kRemainingConn);
+ const int conn_8 = conn_trial->AppendGroup("_conn_count_8", kRemainingConn);
+ const int conn_6 = conn_trial->AppendGroup("_conn_count_6",
+ FieldTrial::kAllRemainingProbability);
+
+ const int conn_trial_grp = conn_trial->group();
+
+ if (conn_trial_grp == conn_4) {
+ net::HttpNetworkSession::set_max_sockets_per_group(4);
+ } else if (conn_trial_grp == conn_6) {
+ // This is the current default value.
+ net::HttpNetworkSession::set_max_sockets_per_group(6);
+ } else if (conn_trial_grp == conn_8) {
+ net::HttpNetworkSession::set_max_sockets_per_group(8);
+ } else if (conn_trial_grp == conn_16) {
+ net::HttpNetworkSession::set_max_sockets_per_group(16);
+ } else {
+ DCHECK(false);
+ }
+
+
// 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.
« no previous file with comments | « no previous file | chrome/renderer/render_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698