diff options
author | Russell Branca <chewbranca@apache.org> | 2018-09-04 18:44:34 +0000 |
---|---|---|
committer | Russell Branca <chewbranca@apache.org> | 2018-09-11 20:25:49 +0000 |
commit | bbf0cc1826635978c5fa9cd238a4351da8849454 (patch) | |
tree | 91e773f0a7c53a43023169b68f6cf80f8f6b543d | |
parent | ee3c4b5d2e58e35a11e6995d47580554a7d7aca8 (diff) | |
download | couchdb-bbf0cc1826635978c5fa9cd238a4351da8849454.tar.gz |
Add read_concurrency options to couch_server ETS
This adds the read_concurrency option to couch_server's ETS table for
couch_dbs which contains the references to open database handles. This
is an obvious improvement as all callers opening database pids interact
with this ETS table concurrently. Conversely, the couch_server pid is
the only writer, so no need for write_concurrency.
-rw-r--r-- | src/couch/src/couch_server.erl | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/couch/src/couch_server.erl b/src/couch/src/couch_server.erl index 50c8caee5..ef895a414 100644 --- a/src/couch/src/couch_server.erl +++ b/src/couch/src/couch_server.erl @@ -230,7 +230,13 @@ init([]) -> ok = config:listen_for_changes(?MODULE, nil), ok = couch_file:init_delete_dir(RootDir), hash_admin_passwords(), - ets:new(couch_dbs, [set, protected, named_table, {keypos, #entry.name}]), + ets:new(couch_dbs, [ + set, + protected, + named_table, + {keypos, #entry.name}, + {read_concurrency, true} + ]), ets:new(couch_dbs_pid_to_name, [set, protected, named_table]), process_flag(trap_exit, true), {ok, #server{root_dir=RootDir, |