Couchbase benchmark: Insert and Get using KeyValue operations very slow compared to Redis

Unfortunately, I don’t have enough reputation to comment on StackOverflow. However, I’ll add a couple of points:

Your parallelization method for the inserts is a bit inefficient, and probably why you’re seeing so much variability. See this post for some information on optimizing parallel operations: How to do .Get<T>(List keys) in SDK 3.x in C#?. Also, your get approach is also not parallelized in the example, it’s sequential.

However, I agree that these timings don’t make much sense. I typically see sub-millisecond times for handling documents using the key/value API. I’m curious as to a few points:

  • Have you tried strong types instead of JObject? It’s possible our particular serializer implementation for JObject is inefficient.
  • You might try tweaking the minimum and maximum connection pool size. When running large numbers of parallel operations having a larger pool of connections may increase performance. Probably not as valuable running entirely on the local machine, though.
  • Are you running Couchbase inside any kind of VM or Docker container, or directly on Windows? If Docker, are you using a Hyper-V VM or WSL 2?