You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by wo...@apache.org on 2017/05/09 20:06:38 UTC

[couchdb] branch master updated: Hibernate couch_stream after each write

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

wohali pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/couchdb.git

The following commit(s) were added to refs/heads/master by this push:
       new  7c3aef6   Hibernate couch_stream after each write
7c3aef6 is described below

commit 7c3aef6999691bd02fbae56a72c991a6150af261
Author: Joan Touzet <wo...@apache.org>
AuthorDate: Mon May 8 22:14:24 2017 -0400

    Hibernate couch_stream after each write
    
    In COUCHDB-1946 Adam Kocoloski investigated a memory explosion resulting
    from replication of databases with large attachments (npm fullfat). He
    was able to stabilize memory usage to a much lower level by hibernating
    couch_stream after each write. While this increases CPU utilization when
    writing attachments, it should help reduce memory utilization.
    
    This patch is the single change that affected a ~70% reduction in
    memory.
    
    No alteration to the spawn of couch_stream to change the fullsweep_after
    setting has been made, in part because this can be adjusted at the erl
    command line if desired (-erl ERL_FULLSWEEP_AFTER 0).
---
 src/couch/src/couch_stream.erl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/couch/src/couch_stream.erl b/src/couch/src/couch_stream.erl
index 913977f..7da422b 100644
--- a/src/couch/src/couch_stream.erl
+++ b/src/couch/src/couch_stream.erl
@@ -259,7 +259,7 @@ handle_call({write, Bin}, _From, Stream) ->
                         buffer_len=0,
                         md5=Md5_2,
                         identity_md5=IdenMd5_2,
-                        identity_len=IdenLen + BinSize}};
+                        identity_len=IdenLen + BinSize}, hibernate};
     true ->
         {reply, ok, Stream#stream{
                         buffer_list=[Bin|Buffer],

-- 
To stop receiving notification emails like this one, please contact
['"commits@couchdb.apache.org" <co...@couchdb.apache.org>'].