HangfireIO / Hangfire

An easy way to perform background job processing in .NET and .NET Core applications. No Windows Service or separate process required
https://www.hangfire.io
Other
9.32k stars 1.69k forks source link

Sql DeadLocks #2406

Open McSaverInvestments opened 3 months ago

McSaverInvestments commented 3 months ago

Im currently running scheme 9, I'm seeing a lot of xp_userlock and (@id bigint)select InvocationData, StateName, Arguments, CreatedAt from [HangFire].Job with (readcommittedlock, forceseek) where Id = @id select Name, Value from [HangFire].JobParameter with (forceseek) where JobId = @id

that are taking a long time to complete and creating deadlock. I'm only try to process about 300 jobs at the moment.

This is my current setup.

image

image

image

odinserj commented 3 months ago

Hm, do you have any deadlock graphs or at least resource names for these locks available? Also, what version of Hangfire.Core and Hangfire.SqlServer you are using? I haven't seen deadlocks in Hangfire for a long time already.

McSaverInvestments commented 3 months ago

@odinserj Hello, I'm current using version 1.8.12. The only was I was able to get around this issue was reduce my work counts by a factor of 10. Any other idea or suggestions, thanks?