We have a couchbase-community 7.0.2 cluster with 3 nodes with more or less 2.5mio documents, 1 sync-gateway 2.8 running with import_docs=true and 3 sg running with without import_docs.
The sync function creates a channel per document (maybe not the best approach).
What troubles me now is the size of the sg_channel_x1 index:
It’s likely that the large number of items are coming from tombstones (deleted documents). If you’re doing a lot of deletions in a short space of time (e.g. in a dev/test environment) these could accumulate fairly quickly.
We keep these around for ~30 days by default (based on the server’s metadata purge interval setting) so that deletions can be replicated to clients.
These should be cleaned up by a compaction process that runs once per day on SG import nodes to check for items older than the metadata purge interval.
I would certainly rethink your access control model and determine how you want to group and segregate data. Who are your users and what documents belong to each users and what is shared