Commit 588427cc authored by hashimoto's avatar hashimoto Committed by Commit bot

Tweak DOMStorageArea rate limit

Increase the data rate and the commit rate.

BUG=480228

Review URL: https://codereview.chromium.org/1136123006

Cr-Commit-Position: refs/heads/master@{#330278}
parent 284645c3
...@@ -37,8 +37,8 @@ const int kCommitDefaultDelaySecs = 5; ...@@ -37,8 +37,8 @@ const int kCommitDefaultDelaySecs = 5;
// To avoid excessive IO we apply limits to the amount of data being written // To avoid excessive IO we apply limits to the amount of data being written
// and the frequency of writes. The specific values used are somewhat arbitrary. // and the frequency of writes. The specific values used are somewhat arbitrary.
const int kMaxBytesPerDay = kPerStorageAreaQuota * 2; const int kMaxBytesPerHour = kPerStorageAreaQuota;
const int kMaxCommitsPerHour = 6; const int kMaxCommitsPerHour = 60;
} // namespace } // namespace
...@@ -109,7 +109,7 @@ DOMStorageArea::DOMStorageArea(const GURL& origin, ...@@ -109,7 +109,7 @@ DOMStorageArea::DOMStorageArea(const GURL& origin,
is_shutdown_(false), is_shutdown_(false),
commit_batches_in_flight_(0), commit_batches_in_flight_(0),
start_time_(base::TimeTicks::Now()), start_time_(base::TimeTicks::Now()),
data_rate_limiter_(kMaxBytesPerDay, base::TimeDelta::FromHours(24)), data_rate_limiter_(kMaxBytesPerHour, base::TimeDelta::FromHours(1)),
commit_rate_limiter_(kMaxCommitsPerHour, base::TimeDelta::FromHours(1)) { commit_rate_limiter_(kMaxCommitsPerHour, base::TimeDelta::FromHours(1)) {
if (!directory.empty()) { if (!directory.empty()) {
base::FilePath path = directory.Append(DatabaseFileNameFromOrigin(origin_)); base::FilePath path = directory.Append(DatabaseFileNameFromOrigin(origin_));
...@@ -134,7 +134,7 @@ DOMStorageArea::DOMStorageArea(int64 namespace_id, ...@@ -134,7 +134,7 @@ DOMStorageArea::DOMStorageArea(int64 namespace_id,
is_shutdown_(false), is_shutdown_(false),
commit_batches_in_flight_(0), commit_batches_in_flight_(0),
start_time_(base::TimeTicks::Now()), start_time_(base::TimeTicks::Now()),
data_rate_limiter_(kMaxBytesPerDay, base::TimeDelta::FromHours(24)), data_rate_limiter_(kMaxBytesPerHour, base::TimeDelta::FromHours(1)),
commit_rate_limiter_(kMaxCommitsPerHour, base::TimeDelta::FromHours(1)) { commit_rate_limiter_(kMaxCommitsPerHour, base::TimeDelta::FromHours(1)) {
DCHECK(namespace_id != kLocalStorageNamespaceId); DCHECK(namespace_id != kLocalStorageNamespaceId);
if (session_storage_backing) { if (session_storage_backing) {
......
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