[ 
https://issues.apache.org/jira/browse/COUCHDB-3389?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15998846#comment-15998846
 ] 

ASF subversion and git services commented on COUCHDB-3389:
----------------------------------------------------------

Commit 50a738a46701332046a467d070309ef832482656 in couchdb's branch 
refs/heads/master from [~vatamane]
[ https://gitbox.apache.org/repos/asf?p=couchdb.git;h=50a738a ]

Add jittered sleep during replicator shard scanning

This is bringing back previous code:

https://github.com/apache/couchdb/blob/884cf3e55f77ab1a5f26dc7202ce21771062eae6/src/couch_replicator_manager.erl#L940-L946

This is to avoid a stampede during startup when potentially a large number
shards are found and change feeds have to be opened for all of them at the
same time.

The average jitter value starts at 10 msec for first shard, then goes up to
1 minute for 6000th shard and stays clamped at 1 minute afterwards. (Note:
that's the average, the range is 1 -> 2 * average as this is a uniform
random distribution).

Some sample values:

 * 100 - 1 second
 * 1000 - 10 seconds
 * 6000 and higher - 1 minute

Jira: COUCHDB-3389


> Bring back jittered delay during replication shard scan
> -------------------------------------------------------
>
>                 Key: COUCHDB-3389
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-3389
>             Project: CouchDB
>          Issue Type: Bug
>            Reporter: Nick Vatamaniuc
>
> When we switched to using mem3 db for shard discovery we dropped jittered 
> delay during shard scan. On a large production system with thousands of 
> replicator dbs, back to back shard notification, which spawn change feeds can 
> cause performance issues.
> https://github.com/apache/couchdb/blob/884cf3e55f77ab1a5f26dc7202ce21771062eae6/src/couch_replicator_manager.erl#L940-L946



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to