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 2018/09/10 19:33:50 UTC
[couchdb] 02/03: Don't send update_lru messages when disabled
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 19a390c8ea41bf84d1a38096e622b10eb94daf7c
Author: Russell Branca <ch...@apache.org>
AuthorDate: Tue Sep 4 18:53:56 2018 +0000
Don't send update_lru messages when disabled
The couchdb.update_lru_on_read setting controls whether couch_server
uses read requests as LRU update triggers. Unfortunately, the messages
for update_lru on reads are sent regardless of whether this is enabled
or disabled. While in principle this is harmless, and overloaded
couch_server pid can accumulate a considerable volume of these messages,
even when disabled. This patch prevents the caller from sending an
update_lru message when the setting is disabled.
---
src/couch/src/couch_server.erl | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/src/couch/src/couch_server.erl b/src/couch/src/couch_server.erl
index ef895a4..c4b7bf1 100644
--- a/src/couch/src/couch_server.erl
+++ b/src/couch/src/couch_server.erl
@@ -101,9 +101,14 @@ open(DbName, Options0) ->
end.
update_lru(DbName, Options) ->
- case lists:member(sys_db, Options) of
- false -> gen_server:cast(couch_server, {update_lru, DbName});
- true -> ok
+ case config:get_boolean("couchdb", "update_lru_on_read", false) of
+ true ->
+ case lists:member(sys_db, Options) of
+ false -> gen_server:cast(couch_server, {update_lru, DbName});
+ true -> ok
+ end;
+ false ->
+ ok
end.
close_lru() ->