You may decide to move the processing to the different process from the main application. For example, your web application will only enqueue background jobs, leaving their performance to a Console application or Windows Service. First of all, let’s overview the reasons for such decision.
You can stop processing background jobs in your main application by simply removing the instantiation of the BackgroundJobServer
class (if you create it manually) or removing an invocation of the UseHangfireServer
method from your OWIN configuration class.
After accomplishing the first step, you need to enable processing in another process, here are some guides:
Same storage requires the same code base
Ensure that all of your Client/Servers use the same job storage and have the same code base. If client enqueues a job based on the SomeClass
that is absent in server’s code, the latter will simply throw a performance exception.
If this is a problem, your client may have references only to interfaces, whereas server provide implementations (please see the Using IoC Containers chapter).
Please use Hangfire Forum for long questions or questions with source code.