We are using HangFire in production Azure SaaS environment and the DTU is reaching to 100% very often. On further analysis, we are seeing the below statement is causing spike.
(@now datetime,@count int)delete top (@count) T from [HangFire].[Job] T with (forceseek)
where ExpireAt < @now
option (loop join, optimize for (@count = 20000))
- How to reduce the batch count from 20000?
- Was that configurable? where?
- Do we need to do run any optimization scripts like reindex? Any recommendation and scripts for that?