Symptoms
We would like SmartForms to be instantly ready when people walk in the door. IIS 8 has some settings to start up app pools. Can we safely make these changes?
http://www.iis.net/learn/get-started/whats-new-in-iis-8/iis-80-application-initialization
Diagnoses
Application Initialization can be used to warm up the SmartForms app pool so the first request by users in the morning does not take an extended period of time. This will not harm K2 functionality. This same scenario can be done with a powershell script as well.
Resolution
K2 runs closely off of the Microsoft stack so any changes made in IIS of this nature are done by preference and will not cause any issues with K2. Think of the Smartforms App pool as any other app pool that you would want to warm up. There are no specific restrictions on enabling this feature with the K2 app pools.
There are two ways to do a warm up for application pools. Utilizing the Application Initialization feature of IIS and running a powershell script at a certain time to warm an app pool. In this case the Powershell script method was chosen to be used as it was easier to have a time set each day to control when the warm up occurred.
To have a script run at a certain time per day you will need to use the Windows Task Scheduler. I have included steps below to set the task that runs the script:
1. Launch Windows Task Scheduler.
2. In the actions pane off the right of the task scheduler click on create a task.
3. On the General tab create a name for the task and a description if you want. Under security options run the task as the Administrator account and I would also select the option to run the task whether or not the user is logged on. This will ensure that even if Administrator is not logged on the script will still run.
4. Navigate to the triggers tab. Select "New...". Here you can choose when the task should execute. You are probably looking to do the task on a schedule and select the weekly option. I am guessing you want it to occur during your work days, so you would select Mon - Fri. Next be sure to set the start time to your specific requirements. Perhaps your employees come in at 8 am you might want to set the task to run at 7 am or 7:30 am. Once preferences are set to your liking click okay to save.
5. Navigate to the actions tab. In the Program/script box enter "PowerShell." In the Add arguments (optional) box enter the value ". Powershell Script name].ps1". Then, in the Start in (optional) box, add the location of the folder that contains the PowerShell script. You may want to create a folder for scripts on your local drive and put this file in there. Perhaps it might be a directory of C:Scripts. Click okay to save.
6. Conditions and Settings tabs are going to be based off of your personal preference so configure these to your liking.
7. When everything is configured to your liking click okay one last time to save the task. Now the first run will start based off of the start date and time you entered in for the trigger. Most likely tomorrow morning at a specific time. You can always go back and edit the task if you need to change the settings.