Commit 6f8273ab authored by tbansal's avatar tbansal Committed by Commit bot

Throttle fetches for data reduction proxy config

1. Remove the retries on 5xx errors (this is currently set to
5 retries). This affects pingback fetcher also.
2. Change the initial retry interval from 1 second to 30
seconds.
3. Increase the max backoff value to 128 minutes.
4. Change jitter to 0.25.

BUG=649188

Review-Url: https://codereview.chromium.org/2363523003
Cr-Commit-Position: refs/heads/master@{#420762}
parent 194f8f3e
......@@ -69,13 +69,13 @@ const uint32_t kMaxBackgroundFetchIntervalSeconds = 6 * 60 * 60; // 6 hours.
// This is the default backoff policy used to communicate with the Data
// Reduction Proxy configuration service.
const net::BackoffEntry::Policy kDefaultBackoffPolicy = {
0, // num_errors_to_ignore
1 * 1000, // initial_delay_ms
4, // multiply_factor
0.10, // jitter_factor,
30 * 60 * 1000, // maximum_backoff_ms
-1, // entry_lifetime_ms
true, // always_use_initial_delay
0, // num_errors_to_ignore
30 * 1000, // initial_delay_ms
4, // multiply_factor
0.25, // jitter_factor,
128 * 60 * 1000, // maximum_backoff_ms
-1, // entry_lifetime_ms
true, // always_use_initial_delay
};
// Extracts the list of Data Reduction Proxy servers to use for HTTP requests.
......@@ -397,9 +397,9 @@ DataReductionProxyConfigServiceClient::GetURLFetcherForConfig(
fetcher->SetUploadData("application/x-protobuf", request_body);
DCHECK(url_request_context_getter_);
fetcher->SetRequestContext(url_request_context_getter_);
// Configure max retries to be at most kMaxRetries times for 5xx errors.
// |fetcher| should not retry on 5xx errors since the server may already be
// overloaded. Spurious 5xx errors are still retried on exponential backoff.
static const int kMaxRetries = 5;
fetcher->SetMaxRetriesOn5xx(kMaxRetries);
fetcher->SetAutomaticallyRetryOnNetworkChanges(kMaxRetries);
return fetcher;
}
......
......@@ -145,9 +145,9 @@ void DataReductionProxyPingbackClient::CreateFetcherForDataAndStart() {
current_fetcher_->SetLoadFlags(net::LOAD_BYPASS_PROXY);
current_fetcher_->SetUploadData("application/x-protobuf", serialized_request);
current_fetcher_->SetRequestContext(url_request_context_);
// Configure max retries to be at most kMaxRetries times for 5xx errors.
// |current_fetcher_| should not retry on 5xx errors since the server may
// already be overloaded.
static const int kMaxRetries = 5;
current_fetcher_->SetMaxRetriesOn5xx(kMaxRetries);
current_fetcher_->SetAutomaticallyRetryOnNetworkChanges(kMaxRetries);
current_fetcher_->Start();
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment