Search code examples
couchbasecouchbase-litecouchbase-sync-gateway

Sync Gateway REST API deletion over capacity


I am using couchbase sync gateway public API

DELETE /{db}/{doc}+?rev=+_rev

for multiple documents async deletion and got error:

error: Service Unavailable, 
reason: Database server is over capacity 

I noticed that

  • Some of the documents deleted successfully and some failed.
  • This only happens for DELETE not for GET, i.e, when I async get multiple documents' revision identifiers via API GET /{db}/{doc}, it is working fine. I guess the reason is GET is lighter.

So question is:

  • What's the capacity of DELETE and how to increase?
  • If no way to increase, how to delete multiple documents in an efficient way?

Thanks!


Solution

  • I'm not sure if the capacity being referred to here lies with the Sync Gateway or with Couchbase Server. I would try increasing the file descriptors on the Sync Gateway as per https://developer.couchbase.com/documentation/mobile/current/guides/sync-gateway/os-level-tuning/index.html.

    If that doesn't work, you might want to try increasing the memory of the Couchbase buckets that you are trying to delete from to see if that changes the available capacity.

    Good luck!