Polling SQL Requests

Hi all,

Currently using Hangfire with SQl Server.

While running SQL Server Profiler, I can see requests made by hangfire on every polling.

What concern me is I see this request at least 20 times on each polling:

exec sp_executesql N'delete top (1) JQ
output DELETED.Id, DELETED.JobId, DELETED.Queue
from [HangFire].JobQueue JQ with (readpast, updlock, rowlock, forceseek)
where Queue in (@queues1)',N'@queues1 nvarchar(4000)',@queues1=N'default'

Why would hangfire issue this so many times ?

This happens because because each worker thread attempts to pick a job for processing. Hangfire has 20 workers by default, hence you see 20 requests. This is perfectly normal.

Ahhh, make sense, thanks !