Only allow leveldb to use the minimum amount of file descriptors.
commit7b00db0efffcf0ee9c3b92658de9cccc11fdd430
authordgrogan@chromium.org <dgrogan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Tue, 16 Jul 2013 19:54:40 +0000 (16 19:54 +0000)
committerdgrogan@chromium.org <dgrogan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Tue, 16 Jul 2013 19:54:40 +0000 (16 19:54 +0000)
tree9769d391314c5ebaecb025528a0a1ea1a8d0d213
parent31ed00d72dcc98b705ae0de6cc3aefcc98c31e12
Only allow leveldb to use the minimum amount of file descriptors.

By default, leveldb will use up to 1000 file descriptors at
a time. The per-process limit on CrOS is 1024. This can
cause file descriptor exhaustion and, as issue 14137 points
out, chrome doesn't handle that situation gracefully.

This change will make leveldb only keep 64 files open in
its cache. The target size for each file is 2mb, so
databases under ~128mb will not be affected.
Larger databases that perform many random reads might see a
negligible performance decrease.

BUG=251385
R=derat@chromium.org, hashimoto@chromium.org, jsbell@chromium.org, marja@chromium.org, mpcomplete@chromium.org, nhiroki@chromium.org, rdevlin.cronin@chromium.org, tzik@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@211829 0039d316-1c4b-4281-b951-d872f2087c98
13 files changed:
chrome/browser/chromeos/contacts/contact_database.cc
chrome/browser/chromeos/drive/file_cache_metadata.cc
chrome/browser/chromeos/drive/resource_metadata_storage.cc
chrome/browser/performance_monitor/database.cc
chrome/browser/sync_file_system/drive_backend/drive_metadata_store.cc
chrome/browser/sync_file_system/drive_backend/metadata_database.cc
chrome/browser/sync_file_system/drive_backend/metadata_database_unittest.cc
chrome/browser/sync_file_system/drive_backend/metadata_db_migration_util_unittest.cc
chrome/browser/value_store/leveldb_value_store.cc
webkit/browser/dom_storage/session_storage_database.cc
webkit/browser/fileapi/sandbox_directory_database.cc
webkit/browser/fileapi/sandbox_origin_database.cc
webkit/browser/fileapi/syncable/local_file_change_tracker.cc