Hangfire
Hangfire copied to clipboard
What's the reasonable number of recurring jobs
I'm working with an application that has more than 50k+ recurring jobs. Besides that, the vast majority of them are triggered every 20 minutes, which seems to be too much for Hangfire. The application works on a default configuration and on a quite powerful machine. CPU and memory usage are low.
So the question is, what's the reasonable number of recurring jobs? And if it's just a couple of thousands, shouldn't it be mentioned somewhere in the docs?
Actually there's no any reasonable limits, an Hangfire will slowly enqueue all of them, so everything depends on a storage. However, in recent 1.8.12 version I have added the MaxDegreeOfParallelismForSchedulers experimental option available in the BackgroundJobServerOptions (can be modified when calling AddHangfireServer or UseHangfireServer) that allows to speed up delayed and recurring job schedulers by changing job states in parallel, instead of sequentially. Please try using this option and let me know about the results.