marcoCasamento / Hangfire.Redis.StackExchange

HangFire Redis storage based on original (and now unsupported) Hangfire.Redis but using lovely StackExchange.Redis client
Other
456 stars 109 forks source link

Connection pool size #20

Closed VoidMonk closed 8 years ago

VoidMonk commented 8 years ago

Hi Marco,

Is there a Redis connection pool limit defined (and if so, configurable) in this lib? The original Hangfire.Redis lib had a limit of 50 connections, due to which the Hangfire job server WorkerCount had to be defined accordingly (to keep it under the storage connection pool limit).

Cheers.

marcoCasamento commented 8 years ago

Hi Ashutosh, no, it doesn't. StackExchange.Redis handle concurrency through multiplexing, it uses a single client to Redis that efficiently pipe requests from multiple thread (workers) to a single channel. One thing that may worth to note, is that as the load to Redis increase, you may have to adjust the syncTimeout accordingly (default is 1") to something greater. It express the maximum allowed time for synchronous operations here you can find more info on configuration: https://github.com/StackExchange/StackExchange.Redis/blob/master/Docs/Configuration.md Br, Marco

----- Messaggio originale ----- Da: "Ashutosh Nilkanth" notifications@github.com Inviato: ‎18/‎02/‎2016 06:27 A: "marcoCasamento/Hangfire.Redis.StackExchange" Hangfire.Redis.StackExchange@noreply.github.com Oggetto: [Hangfire.Redis.StackExchange] Connection pool size (#20)

Hi Marco, Is there a Redis connection pool limit defined (and if so, configurable) in this lib? The original Hangfire.Redis lib had a limit of 50 connections, due to which the Hangfire job server WorkerCount had to be defined accordingly (to keep it under the storage connection pool limit). Cheers. — Reply to this email directly or view it on GitHub.

VoidMonk commented 8 years ago

Thanks, that makes sense. With Hangfire.Redis.StackExchange, is it just a matter of setting syncTimeout before setting Hangfire storage, like this:

var redisConfigOptions = new ConfigurationOptions { SyncTimeout = 10000 };

Hangfire.GlobalConfiguration.Configuration.UseStorage<RedisStorage>(new RedisStorage());
VoidMonk commented 8 years ago

Any idea about where/how to set SyncTimeout, so that it plays with StackExchange.Redis and Hangfire.Redis.StackExchange?

marcoCasamento commented 8 years ago

Hi Ashutosh, sure:

var rs = new RedisStorage("myRedisSrv:6379,syncTimeout=5000"); Hangfire.GlobalConfiguration.Configuration.UseStorage(rs);

the string part is the connectionstring and it supports everything explained here https://github.com/StackExchange/StackExchange.Redis/blob/master/Docs/Configuration.md

br, Marco

Il giorno mer 9 mar 2016 alle ore 07:42 Ashutosh Nilkanth < notifications@github.com> ha scritto:

Any idea about where/how to set SyncTimeout, so that it plays with StackExchange.Redis and Hangfire.Redis.StackExchange?

— Reply to this email directly or view it on GitHub https://github.com/marcoCasamento/Hangfire.Redis.StackExchange/issues/20#issuecomment-194140861 .

VoidMonk commented 8 years ago

Thanks.