Can you explain more about “high lock rate”?
My lock contention rate is obtained through Visual Studio Load Testing framework and also from the Windows performance monitor (.NET CLR LocksAndThreads -> Contention Rate / sec)
If you’re building an ASP.NET web application, it is better to use the async/await actions, eg GetAsync, UpsertAsync, QueryAsync, etc. This is because the async/await operations do not block the current thread, and instead release resources back to the host process to re-use until a response is received.
Let me clarify, I am not talking about the execution of the Couchbase SDK methods, but rather the object lifetimes of
Cluster and (indirect)
Bucket instances. Since there is always only one
Cluster instance throughout the lifecycle of the ASP.NET application, the construction of all application service classes depending on
Cluster, that may or may not be singletons, must compete for this instance, thus causing the lock contention.
Also, can you confirm what SDK version, cluster version and what services (Key/Value, Views, N1QL) you’re using. There may be some additional steps that you could take to improve concurrency.
- .NET SDK version: 2.4.5
- Cluster version: 4.6.2-3905-enterprise
- Services in use: Key/Value, Index, N1QL
Thanks for looking into my issue.