I’m running Couchbase 4.5, 3 data nodes and 1 index node. We have about 200k documents in the system, and we are using memory optimized indexes. We use Couchbase Sync Gateway to replicate with mobile devices.
I’ve noticed that when a mobile device syncs, many documents are put into the ‘remaining to be indexed’ queue for my N1QL indexes. I see this happen on the indexer node dashboard. It usually takes 5 - 10 seconds before that queue gets emptied out.
I have been doing N1QL queries on the server side with the ‘request plus’ setting enabled, to guarantee consistency. So when a mobile device syncs, all other N1QL queries hang until the ‘remaining to be indexed’ queue is emptied. This makes sense given how ‘request plus’ is supposed to work.
What I don’t understand is how to improve the performance of indexing. Is it possible that I just have a N1QL index that takes a long time to compute? If so, how would I identify that? Do I need to scale up my hardware? My cpu usage and memory are not even close to capped, so what would I need to scale?