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 to AlwaysRunning. 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 to true. 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.
Make sure you have the Application Initialization feature 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:

  1. the Application Initialization feature has been installed;
  2. the Start Mode of the application pool is set to AlwaysRunning;
  3. 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).
  4. Preload Enabled is set to true in the advanced settings of the minions website.