ctstone / csredis

.NET client for Redis and Redis Sentinel (2.8). Includes both synchronous and asynchronous clients.
Other
292 stars 111 forks source link

Slow Sentinel Performance #5

Closed dbartokthomas closed 10 years ago

dbartokthomas commented 10 years ago

When trying to use csredis in a master->slave scenario using Sentinel, performance of getting slave/master is incredibly bad. See post on stack overflow...

http://stackoverflow.com/questions/22908507/redis-sentinel-c-sharp-client/22913368#22913368

According to the redgate profiler, RedisConnection.Dispose() is taking around 600ms each time (_asyncReader.Wait()) causing huge delays.

I have taken a copy of the code, removed all the Async code, and it storms through, getting a slave/master in under 10ms!

image

kevinayers commented 10 years ago

Same here - I've had erratic behavior with the async methods. I've removed them and now its a lot more stable calling the sentinel server

ctstone commented 10 years ago

Thanks all for the feedback. I'm working on an overhaul to the underlying framework that should improve async performance.

ctstone commented 10 years ago

FYI Async performance should be back to normal in the latest commit b6a06179da003d19cb9f1175419faf7c1787b4b9

There is also a new class, RedisSentinelManager that can be used to manage sentinel/master connections