You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by da...@apache.org on 2019/10/24 18:13:22 UTC

[couchdb] 06/06: Set a high priority on couch_server

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

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

commit 27ffa2e8a21f1e770565ee85224bbbbd93cef8ee
Author: Paul J. Davis <pa...@gmail.com>
AuthorDate: Wed Sep 19 14:39:09 2018 -0500

    Set a high priority on couch_server
    
    In a VM with lots of processes couch_server can end up slowing down
    purely to not being scheduled which in turn will cause its message queue
    to backup. We've attempted this before but due to message passing have
    never seen it have a significant effect. However, now that we're
    actively avoiding synchronous message passing inside the man loop this
    has a significant effect by being able to process messages as soon as it
    has one in its mailbox.
---
 src/couch/src/couch_server.erl | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/couch/src/couch_server.erl b/src/couch/src/couch_server.erl
index 6480d59..2b0b684 100644
--- a/src/couch/src/couch_server.erl
+++ b/src/couch/src/couch_server.erl
@@ -219,6 +219,7 @@ close_db_if_idle(DbName) ->
 
 init([]) ->
     couch_util:set_mqd_off_heap(?MODULE),
+    process_flag(priority, high),
 
     % Mark pluggable storage engines as a supported feature
     config:enable_feature('pluggable-storage-engines'),