High CPU Usage, high latency

We use Hangfire 1.8.5. We have 3 physical servers, separate for sql server, Hangfire dashboard and windows service for hangfire background server.

Windows service server has 12 Processor and we set 36 background workers.

We have 30 recurring jobs each having different interval. Each recurring job enqueues few more jobs.

It works normally when start (or restart) the service when 36 or more jobs in the queue dashboard shows 36 jobs in “processing” and latency for each job is also very low.

But after couple of hours latency keeps increasing and very less number of jobs are in “processing” while it still shows 36 active workers. And cpu usage goes high.

I meant to write this up but check the fragmentation levels on your hangfire tables. I recently solved a massive CPU problem on a clients system because the fragmentation on the SQL indexes seemed to spiral out of control (it was an Azure SQL server system)

I checked my SQL server but the my SQL server is separate with windows server so my SQL server is working normally

Did you check the fragmentation (Just in Case)?

My SQL server is in Productions. So I told to DBA for check it out.

1 Like

DBA checked it out but it’s same problem.