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

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

commit 2c4b6a138b981105b293d0e375adca1c72ec24b0
Author: Nick Vatamaniuc <[email protected]>
AuthorDate: Wed Apr 29 00:43:42 2026 -0400

    Increase view queue size from 100KB to 10MB
    
    100KB was undersized given the 100 batch size used in the process_doc call.
    100 docs as small as 1KB will already start to get serialized and not take
    advantage of the work queue buffering. Make it 10MB to fit about 10 batches 
of
    1MB each and be a bit under the min_writer_size default of 16MB.
---
 rel/overlay/etc/default.ini                   | 6 ++++--
 src/couch_mrview/src/couch_mrview_updater.erl | 2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/rel/overlay/etc/default.ini b/rel/overlay/etc/default.ini
index df24e1d44..eabfc3c9b 100644
--- a/rel/overlay/etc/default.ini
+++ b/rel/overlay/etc/default.ini
@@ -497,8 +497,10 @@ hash_algorithms = sha256, sha
 ; JS mapper and the disk writer.
 ; Whichever limit happens to be hit first is the one that takes effect.
 
-; The maximum queue memory size
-;queue_memory_cap = 100000
+; The maximum queue memory size. view update gen_server batch size is 100, so 
the
+; 10MB default would keep about 10 batches of 10KB docs in the queue. Also 
10MB is
+; also slightly smaller than the min_writer_size of 16MB
+;queue_memory_cap = 10485760
 ; The maximum queue length
 ;queue_item_cap = 500
 
diff --git a/src/couch_mrview/src/couch_mrview_updater.erl 
b/src/couch_mrview/src/couch_mrview_updater.erl
index 4238e6b7d..34631442c 100644
--- a/src/couch_mrview/src/couch_mrview_updater.erl
+++ b/src/couch_mrview/src/couch_mrview_updater.erl
@@ -20,7 +20,7 @@
 -define(REM_VAL, removed).
 
 start_update(Partial, State, NumChanges, NumChangesDone) ->
-    MaxSize = config:get_integer("view_updater", "queue_memory_cap", 100000),
+    MaxSize = config:get_integer("view_updater", "queue_memory_cap", 10485760),
     MaxItems = config:get_integer("view_updater", "queue_item_cap", 500),
     QueueOpts = [{max_size, MaxSize}, {max_items, MaxItems}],
     {ok, DocQueue} = couch_work_queue:new(QueueOpts),

Reply via email to