Hangfire jobs stuck in processing state

This question was handled theoretically on stackoverflow here. I have the same issue of processing a large text file (2MB) where my processing worker gets stuck in my asp.net solutions.
My question, how do you avoid that hangfire gets suspended by IIS on my development and production server?

This may sound like an oversimplification - but consider running your Hangfire processes as a Windows Service. That way - you can separate your tiers - and preserve IIS processing power for serving pages.

I come from the linux side, so running things in the background is something that I’m familiar with, but not in windows. So you are basically saying that I should outsource my hangfire mechanism into another project like a console project and then auto start it?

Yes.

That way, your console and worker process(es) are not tied together.

For example, in my environment, I have the following:

  1. Dashboard running on an Azure Web App
  2. Default Queue Processor running on Local VM
  3. Default Queue Processor running on Local VM
  4. Default Queue Processor running on Local VM
  5. Dedicated Queue Processor running on Local VM
  6. Cache Queue processor running on remote VM

IIS is finickey - it recycles the app pool seemingly at random. I started out processing my HF jobs on IIS - but found it too unreliable. So, I moved to a console app (actually series of instances of a console app) - for multiple reasons.

  1. I can spin up as many as I need quickly.
  2. If one dies, another will pick up the slack.
  3. Heavy loads won’t impact IIS performance of my main app.
  4. Higher throughput (theoretically - I haven’t tested this) - because you’re not dealing with the overhead of IIS

That’s what’s in my head right now. I’m no expert - but feel free to ask follow-up questions!

I’m no expert either but I was able to spin up several hf processes. But could you upload an example console application to github?
And if I put hf in a seperate console application, do I have access to the hf dashboard. I was googling around, apparently you need to do an owin web application, but I only saw some snippet code.