Recently I had to set up a Sitecore Commerce Minions role manually. I thought it was simple, because in the past I had already found out that you need to make sure you set the application pool to AlwaysRunning
. So I did.
Unfortunately, I found out that even though it was set to AlwaysRunning
, the minions didn't start automatically. And worse, if I started the Minions role manually, it would often die after 20 minutes. So, something was wrong.
Time to dive into the SIF scripts that are used to install the commerce environment on my development machine. There I found out three things:
- On the application pool, you need to set the
Start Mode
toAlwaysRunning
. I already knew that. - Make sure that
Regular Time Interval (minutes)
in the Recycle section is set to 0. Should have known that. - In the advanced settings of the minions website, set
Preload Enabled
totrue
. Also didn't know that.
Looking at the SIF script, this should be it, right?
Unfortunately, no. Even though my manually configured Minions settings were now exactly the same as my out-of-the-box version, it would not start automatically.
Looking for more information on how to set up application pools that are always running I found this piece of documentation on the Microsoft site: IIS 8.0 Application Initialization.
That page contains amongst others, the pre-requisites for application initialization:
The Application Initialization feature requires IIS 8.0 to be installed. In addition, the Application Initialization feature within the IIS "Application Development" sub-feature needs to be installed.
I checked the server I was installing the minions role on and indeed, the Application Initialization feature was not installed. After installation, the minion started up automatically.
In summary
For the minions to run automatically you have to make sure:
- the Application Initialization feature has been installed;
- the
Start Mode
of the application pool is set toAlwaysRunning
; - in the Advanced Settings of the application pool, make sure that
Regular Time Interval (minutes)
in the Recycle section is set to 0 (in general, make sure there are no recycle settings set that would recycle the application pool under normal circumstance). Preload Enabled
is set totrue
in the advanced settings of the minions website.