StackExchange.Redis icon indicating copy to clipboard operation
StackExchange.Redis copied to clipboard

Higer CPU usage for redis cluster than redis instance

Open limeng05 opened this issue 5 years ago • 5 comments

We migrated our redis server to redis cluster, and using the SDK version is 2.2.4 from nuget. Seems currently the CPU usage is 30% more higher than before, is it normal?

limeng05 avatar Jan 04 '21 01:01 limeng05

Are we talking about CPU on the cluster or CPU on the client?

NickCraver avatar May 20 '21 11:05 NickCraver

Are we talking about CPU on the cluster or CPU on the client?

CPU on the client

limeng05 avatar May 21 '21 01:05 limeng05

We noticed the same for our client. The difference is we are on .Net framework and were using a mix of Sync and Async call. Switching all calls to Async reduce the contention (since it uses 1 backlog and 1 worker vs multiple requests trying to grab the lock.)

After that the CPU usage is still high ~20%, which I have not have time to dig into why.

Dao007forever avatar May 21 '21 19:05 Dao007forever

We noticed the same for our client. The difference is we are on .Net framework and were using a mix of Sync and Async call. Switching all calls to Async reduce the contention (since it uses 1 backlog and 1 worker vs multiple requests trying to grab the lock.)

After that the CPU usage is still high ~20%, which I have not have time to dig into why.

Thanks for your information

limeng05 avatar May 25 '21 01:05 limeng05

@mgravell tagging because this may be the allocation issue on a miss we mentioned (wasn't sure where that is but happy to take a peek).

NickCraver avatar Feb 08 '22 03:02 NickCraver

This was improved in #2110 (released in 2.6.45+), if you're still seeing issues after this please chime in but we believe this is corrected.

NickCraver avatar Aug 21 '22 14:08 NickCraver