This is an automated email from the ASF dual-hosted git repository.

davisp pushed a commit to branch couch-server-improvements-with-deadline
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 8c64ee74e051add907889b2c570a955134c3a7f6
Author: Russell Branca <[email protected]>
AuthorDate: Tue Sep 4 18:44:34 2018 +0000

    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.
---
 src/couch/src/couch_server.erl | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/couch/src/couch_server.erl b/src/couch/src/couch_server.erl
index 50c8cae..ef895a4 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,

Reply via email to