{"id":8117,"date":"2015-11-26T13:55:39","date_gmt":"2015-11-26T13:55:39","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2015\/11\/26\/pouchdb-replicate-from-couchdb-very-slow-open-source-projects-pouchdb-pouchdb\/"},"modified":"2022-08-30T15:03:00","modified_gmt":"2022-08-30T15:03:00","slug":"pouchdb-replicate-from-couchdb-very-slow-open-source-projects-pouchdb-pouchdb","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2015\/11\/26\/pouchdb-replicate-from-couchdb-very-slow-open-source-projects-pouchdb-pouchdb\/","title":{"rendered":"pouchdb replicate from couchdb : very slow-open source projects pouchdb\/pouchdb"},"content":{"rendered":"<p><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/c3821ef283ae4c72f6156963916ae8d0?s=128&amp;d=identicon&amp;r=PG&amp;f=1\" \/> <strong>Tom Grant<\/strong><\/p>\n<p>I assume you&#8217;re using the PouchDB.replicate function<\/p>\n<p>In that case, try modifying the <code>batch_size<\/code> option:<\/p>\n<pre><code>PouchDB.replicate('mydb', 'http:\/\/localhost:5984\/mydb', {batch_size: large_val})\n<\/code><\/pre>\n<p>where <code>large_val<\/code> is higher than the default of <code>100<\/code>. The higher the value, the faster the replication should go, but the more memory it will use, so be careful.<\/p>\n<p>See the API reference<\/p>\n<p>Edit: Also note the option <code>batches_limit<\/code> which defaults to <code>10<\/code>. This is how many requests may run in parallel at any time, so the number of documents in memory equals <code>batch_size * batches_limit<\/code>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Tom Grant I assume you&#8217;re using the PouchDB.replicate function In that case, try modifying the batch_size option: PouchDB.replicate(&#8216;mydb&#8217;, &#8216;http:\/\/localhost:5984\/mydb&#8217;, {batch_size: large_val}) where large_val is higher than the default of 100. The higher the value, the faster the replication should go, but the more memory it will use, so be careful. See the API reference Edit: [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-8117","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/8117","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=8117"}],"version-history":[{"count":1,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/8117\/revisions"}],"predecessor-version":[{"id":8608,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/8117\/revisions\/8608"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=8117"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=8117"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=8117"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}