You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2020/02/28 22:36:06 UTC

[GitHub] [couchdb] nickva commented on issue #2612: Occasional extremely slow /_changes request

nickva commented on issue #2612: Occasional extremely slow /_changes request
URL: https://github.com/apache/couchdb/issues/2612#issuecomment-592760943
 
 
   `
   [notice] 2020-02-28T05:42:34.120799Z couchdb@10.7.65.122 <0.15451.0> 76934fa50d ******:5984 10.7.65.121 admin GET /configs/_changes?feed=continuous&style=all_docs&since=%221065727-g1AAAABWeJzLYWBgYMxgTmEQTs4vTc5ISXIwNNAz1zMz1TM0MswBSjIlMuSxMPwHgqwM5iQGAaf_uUBRdvMkQ0vDRDPs-rIAuoQWpw%22&timeout=10000 200 ok 16978
   `
   
   > The distribution of long response times looks a little odd. For example, I see a lot of response times of 10,003-10,005ms, almost as if there's been some sort of timeout at 10,000ms
   
   Exactly. There is a timeout. What the timeout means is that as long there are changes on the source, it will stream them. There could be say 100M documents and they should all stream out. Then, after they are all done and the stream is all caught up, it will sleep / wait for 10 more seconds to see if there would be more changes coming. Then if there are no more changes, the feed will timeout and stop. The replicator will then start a new request from the last update sequence.
   
   
   That timeout is part of the normal replication protocol.  When I measure requests latency for example I always exclude _changes feeds as they have these long running connections that skew the results.
   
   That timeout parameter is also derived from a setting you can configure:
   
   https://docs.couchdb.org/en/stable/config/replicator.html#replicator/connection_timeout
   
   
   And it is `connection_timeout / 3`. If you know you only replicate locally, you can set that value to something lower. So example if it is set to 6000 (msec), then the `timeout` in the _changes requests will be 2000 msec which is 2 seconds. However that also means that idle replication will continuously restart their requests every 2 seconds which doesn't seem that great but if you want that it's something you can configure.
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services