Q: the sever cpu occupy very high when sync data from client

hi
I delete a bucket and recreate it. then the couchbase lite client will resync data from its local database. I inspect the server CPU status, it’s running very high.


the cbq-engine occupy a lot of CPU resources.

sync_gateway log below:


one action consumes about 2-3 seconds.

my env:
couchbase server 6.0
sync-gateway 2.1
couchbase lite 2.1.2

how can I resolve this problem?
thanks!

angular

When Sync Gateway syncs to a CB Server bucket, it needs to create a bunch of meta data. This can be pretty CPU intensive. I know this may sound trite, but I’d avoid deleting buckets in general, if you can.

Having said that, it looks like the problem is with determining channel access and the N1QL query that needs to perform. @adamf any thoughts on this?

The high number of access grants for the same principal suggests that the docs you are pushing are all triggering new (redundant?) access grant for the same user. That may account for some of the CPU usage you’re seeing.

hi @hod.greeley @adamf,

thanks for you reply. I make a mistake in sync gateway function, I use access() to every document, but in my scenes not need to do it. access() will occupy very high CPU resources when Concurrent. I already fix this issue.

thanks

angular

1 Like