I’ve started my project with Spring Data Couchbase and its repositories first. Then I noticed that after some amount of load the couple of service and Couchbase cluster hits glass ceiling, sort of. Load comes from 1 service to 6 servers in Couchbase cluster at approximately 12.5K rps. I’ve fired java profiler and here’s what it shows from service prospective:
as result here’s how server’s CPU load looks like:
Basically IO thread burns its own CPU core. Clearly the bottleneck.
It’s quite obvious that Spring Data Couchbase use sync operations so I ditched it and turned code into regular
Bucket.async().get(..., RawJsonDocument.class).map(...) with, well,
toBlocking().single() before it goes out of web service method. Surprisingly, nothing changed in CPU and CB requests pattern. Still one core is at ~100% and up to ~12.5K requests on CB.
By the nature of the project I don’t have much of requests to CB per service call. It’s usually 1-1 or 2-1. Is there any way for SDK to utilize more than one IO thread in such scenario?