You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ch...@apache.org on 2018/09/11 20:26:37 UTC

[couchdb] 01/02: Add read_concurrency options to couch_server ETS

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

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

commit bbf0cc1826635978c5fa9cd238a4351da8849454
Author: Russell Branca <ch...@apache.org>
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,