marcoCasamento / Hangfire.Redis.StackExchange

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

Unbounded growth of the job:* keyspace #70

Closed Matthew-Davey closed 6 years ago

Matthew-Davey commented 6 years ago

I'm evaluating Hangfire.Redis.StackExchange at the moment and I've been doing some load testing (5000 jobs / minute). I've noticed what looks like unbounded growth of the job:* keyspace. It looks like a permanent record of every job execution is stored there, is that correct?

Does this get cleaned up or have a TTL? Or is there any way to set a limit on the number of items stored there?

pieceofsummer commented 6 years ago

This is not related to a particular storage.

Finished jobs live for 24 hours by default before they're cleaned up. You can change that via ApplyStateContext.JobExpirationTimeout property in IApplyStateFilter, or (if you're using dev branch of Hangfire) via WithJobExpirationTimeout extension method.

Matthew-Davey commented 6 years ago

Thanks for clearing that up for me, I added an IApplyStateFilter implementation with a configrable timeout. Apologies for raising this query in the wrong project!