Redis cache stats entries - time to live

I’m using Hangfire Pro with a Redis backend - it’s great, but can get spendy pretty fast so I am trying to persist as little as possible.
I have all my batches and jobs expiring in an hour (TTL), which seems to be the minimum, but I have stats entries that have a time to live of 30 days - anyone know how to get set stats TTL to a lower value?


Hey @Anthony_Hawkley,

We had the same issue running on cloud Redis instance. We dealt with it the same way, except we used an attribute that set the expire time to 1 min. This got us around the 1 hour limitation. Keep in mind we first had set it to 24 hours. This helped bring things back down into more reasonable levels. We are running on a 250MB instance.

We left the batch jobs at default 7 days because we don’t process an unruly amount, and have seen our memory requirements be much more stable, so on a weekly bases we’re shedding around 7MB, growing 1MB.

We continue to monitor it, but it’s now running at a more manageable level. We are currently pushing about 100k+ jobs a day through it.

One thing I couldn’t help but notice with your question was the size of the record you were pointing out. 80 bytes. For us that was an acceptable weight to carry for a bounded time.