Increasing Sync Gateway Throughput

Context

I have a Mac app using the Couchbase Lite Swift SDK that connects to Capella and Sync Gateway.

There are ~5,600,000 documents in the bucket, all of which must be synced down to client devices. I’m seeing a throughput of about 2,500 documents-per-second during initial replication, which means it takes almost 40 minutes to fully sync this database from scratch.

Question

Is 2,500 documents-per-second essentially the limit of the Replicator? Or are there ways to substantially increase this?

Details

  1. The documents are all fairly small. No attachments. (Think of an iTunes library with a bunch of songs that have artist, album, etc. fields).

  2. The network connection is not saturated (at least on the client end).

  3. The Database cluster is the lowest paid tier, paired with the lowest paid tier for the App Service node. (Together, these cost $470/mo, which is not insignificant and is about 4x more expensive than the equivalent setup at MongoDB, which is what we’re migrating from.)

  4. The Sync Gateway is connected to only one client for this test: me.

  5. Delta sync is disabled (I don’t think it would improve the initial sync times?)

  6. Unfortunately, syncing every document to the client is a requirement. I cannot improve sync times by limiting what syncs.