This article has been moved to its new home here: https://benperk.github.io/msdn/2014/2014-01-configure-the-iis-application-initialization-module.html
During my many years of active IIS administration which hosted ASP.NET application, we had many discussions about why the first request to the web site took longer than those coming after. In short, it’s because the first request, after a restart of the process results in a recompilation of the temporary ASP.NET files. In complicated, large scale enterprise applications, the compilation of the temporary ASP.NET files can take seconds. On one of the system I supported, we actually implemented a process that rotated the responsibility for making the first call to the web site each morning at 6AM to make sure none of our users experienced this. Sure, you can pre-compile the code but I am talking about long ago, in IT years…
Now that this feature, Application Initialization exists, there is no longer a need for that or anything like it. Once you recycle or restart the IIS process, a request is sent to the website and the binaries are compiled and ready for fast usages.
To install the feature you can use the Web Platform Installer on IIS 7.5, as shown in Figure 1 or install it as a feature in IIS 8/8.5+.
Figure 1, Install Application Initialization using the Web Platform Explorer
Figure 2, Install Application Initialization using the Install Feature
There is a good set of instruction on how to setup Application Initialization here. I will cover similar topics, but expand, simplify a little.
After the feature has been installed and you have configured an ASP.NET web site, set the startMode of the application pool associated to the web site in which you want to enable Application Initialization on to AlwaysRunning. Figure 3 illustrates a method for doing this using the Configuration Editor.
Figure 3, Set application pool to AlwaysRunning
By setting the startMode to AlwaysRunning, when you recycle the process or perform a reboot, the IIS process (W3WP.exe) is started up automatically. This is not the case by default, where after a restart or reboot, the IIS worker process is not started until a request is sent to it. Apply these changes and open the Task Manager, you will notice that there is a W3WP process running for the associated web site, even though there has been no request made to it.
To test this feature further, download and install Process Explorer here, find the W3WP process for the web site, open the details window and notice that there is no .Net Assemblies tab. Figure 4 illustrates this.
Figure 4, Use Process Explorer to view W3WP compiled assemblies, not present
You can also take a quick look at the compiled ASP.NET files which already exist in the C:WindowsMicrosoft.NETFramework64v4.0.30319Temporary ASP.NET Filesroot directory to set a baseline. Note: this assume you are using .NET 4 on a 64bit machine.
You should not see any compiled ASP.NET files for this web site because it has not yet been accessed.
You should not see any compiled ASP.NET files for this web site because it has not yet been accessed.
Access the ASP.NET web site and reopen the details windows for the worker process. You will then see the compiled .NET assemblies, as shown in Figure 5. This will happen only once and future requests to those ASPX files will be handled from the compiled binary which results in much faster response.
Figure 5, Use Process Explorer to view W3WP compiled assemblies, present
In Windows Explorer, navigate to C:WindowsMicrosoft.NETFramework64v4.0.30319Temporary ASP.NET Filesroot and see if the ASP.NET file has been compiled… You can also try matching the names in Figure 5 to the .DLL file.
Next, before executing an IISReset, open Task Manager and locate the PID for the W3WP process of the web site worker process. When the existing worker process is shut down and a new one created. Have both a command prompt to enter the command shown in Figure 6 plus the Task Manager and watch the removal of the existing W3WP process and the creation of a new one automatically, it is automatic because startMode=AlwaysRunning.
1Aug 16, 2016, 3:47 AMsubham modiĊBook 3 - The Prisoner of Azkaban.pdf2107kv. 1Aug 16, 2016, 3:54 AMsubham modiĊBook 5 - The Order of the Phoenix.pdf4705kv. Harry potter and the cursed child bahasa indonesia pdf. 1Aug 16, 2016, 3:51 AMsubham modiĊBook 4 - The Goblet of Fire.pdf3414kv.
Figure 6, Execute an IISReset
Up to now, IIS is only configured to start the W3WP worker process for the web site, but the initial request that compiles the ASP.NET files still needs to be configured. To perform this, make the following modifications and as shown in Figure 7.
- applicationPool = The name of the web sites Application Pool
- path = the path to the web site, for example a Virtual Directory
- preloadEnabled = true
Figure 7, Configure Application Initialization using Configuration Editor
Apply your changes. To test that everything is working as expected, you can stop the web site configured for Application Initialization and delete the existing ASP.NET temporary files. Check the Task Manager for a worker process, Process Explorer for any .Net assemblies and restart the web site. You should see the worker process automatically started, a request being sent to the web site and the .Net assemblies being compiled.
Is it possible I can use PowerShell command (e,g, New-WebSite) to create a web site and set site's preloadEnabled='true'?
hardywanghardywang2,17433 gold badges4444 silver badges7777 bronze badges
6 Answers
I've been looking for this too, but couldn't find anything in WebAdministration to set this option. Presumably the approach would be to call New-ItemProperty on the correct WebApplication. Unfortunately, I was unable to get the 'default' application for a given website, or to set this property on it. It kinda seems like the WebAdministration module (which enables cmdlets like New-WebSite) was written with earlier versions of IIS in mind, and certainly before the Application Initialization module.
This is a workaround, which forces the setting of these properties by editing the underlying applicationHost.config file. This is a slightly simplified version of a script we're now using. You'll need to run this script as an administrator.
cheekolicheekoli
This should do the trick. You can use the
Knaģisget-itemproperty
to verify that it worked. It took me a while to figure out where to find preloadEnabled
within powershell but if you pipe the site path to get-member
, then you can work your way from there.17k44 gold badges5454 silver badges7171 bronze badges
Jake M.Jake M.
There is in fact a way to do this (assuming you have a single application at / that you want to set it for and you know the name of your site):
Robert MooreRobert Moore
This is a bit late, but this will help others.. This worked for me and was a little less verbose. The key difference is that I removed ApplicationDefaults because I am setting the application, not the defaults here:
WHERE: 'SiteName' might equal Default Web Site'ApplicationName' might equal MyApplication
kirkpabkkirkpabk
Sergei ZinovyevSergei Zinovyev
Old question, but I wanted to share my insights.
I needed to do this from an Octopus post-deployment script, where my App was in the Site root. I tried all the suggested solutions here and the one from Robert Moore was the only one working for me.
However, I ended up using this which also did the job:
tobyplstobypls
Not the answer you're looking for? Browse other questions tagged powershelliis-7.5 or ask your own question.
Using Windows 10 / IIS 10
I have a Web Application and have set the following:
- AppPool: Start Mode = AlwaysRunning
- Web Application: Enable Preload = true
But still, the web application gets shut down:
- A worker process with process id of 'nnnnn' serving application pool 'Ssss' was shutdown due to inactivity. Application Pool timeout configuration was set to 20 minutes. A new worker process will be started when needed.
Okay, the solution is to set the AppPool's Idle-Timeout (minutes) to either be a large number or (I'm guessing zero to signify 'don't').
However, my understanding was that 'AlwaysRunning' overrode the Idle-Timeout - evidently not.
Can someone either explain or point me to something that explains the exactly what each setting does, and how they (don't?) relate to each other.
Thanks
DrGriff
migrated from webmasters.stackexchange.comOct 19 '18 at 11:44
This question came from our site for pro webmasters.
1 Answer
According to this answer you should set the Idle Timeout to 0, even though it may contradict Microsoft documentation.
spacenomyousspacenomyous
IIS or Internet Information Services is a technology included in Windows Server, which provides a security-enhanced, easy-to-manage web server for developing and reliably hosting web applications and web services. This enables organizations to deliver rich, web-based experiences. IIS is not turned on by default on the Windows desktop editions. You have to turn it on.
Let us see now how to enable or turn on Internet Information Services on Windows 8. The procedure remains the same as it was in earlier editions.
Turn On IIS or Internet Information Services on Windows 8
Press Win+R key in combination to bring up the ‘Run’ dialog box. In it, type ‘appwiz.cpl’ and hit the ‘OK’ button.
You will be directed to ‘Programs and Feature’ screen of the ‘Control Panel’. There, in the left pane you will find a link to Turn Windows features on/off. Click on that link.
Now, a new ‘Windows Features’ screen should be visible to you. Scroll and search for the Internet Information Services option and select its check box, to turn on the feature.
Soul calibur 6 custom characters download. Alex Hardline rates this game: 5/5Soul Calibur is the second installment in the Soul series, after a first episode called 'Soul Edge' (or 'Soul Blade' in Western regions).
At this point you can leave settings as default and say OK, but you can certainly expand it and check the other components as well, if you are interested in selecting all or deselecting some.
Once you have configured the desired options as well, hit the ‘OK’ button and wait patiently for few minutes to allow Windows Features to search for required files, install them and apply the changes.
That is all. You will have now successfully installed the new version of IIS Internet Information Services on Windows 8, you will see a new localhost start page. Check out the screen-shot of below.
This is how you can enable or turn on Internet Information services (IIS) on Windows 8.
Go here if you want to learn how to Host your own WordPress blog with Microsoft IIS.
TIP: Download this tool to quickly find & fix Windows errors automatically
Related Posts:
Iis Alwaysrunning
This is a quick step by step of how to setup arcanus to run under IIS via IISNode. While you can run arcanus as a stand-alone server, iisnode offers a handful of useful features to compliment Node.js in a managed environment for us. I prefer running via iisnode myself and arcanus is designed around and tested thoroughly with this setup.
- Download and install the latest version of Node.js.
- Download and install the latest version of iisnode. (Install the full package for your OS architecture.)
- Ensure iisnode has been properly installed as a native module in IIS.
- Start the Internet Information Services (IIS) Manager.
- Choose the server from the left side list.
- Select the main server entry.
- On the right, select 'Modules'.
- Ensure that iisnode is listed here as a native module. If not, add it manually.
- Add a new website (or select an existing one) where you wish to install arcanus.
- Note: Ensure this folder has proper permissions to execute from!
- Note: Ensure this sites application pool has permissions to the folder.
- Open the websites root folder within Explorer.
git clone
arcanus into this websites root folder.- If done properly the root folder should be like:
- ie. C:inetpubyourwebsitearcanus
- ie. C:inetpubyourwebsiteweb.config
- If done properly the root folder should be like:
By default, the settings that IIS sets on the application domains for a website are not ideal for something such as iisnode to run under. You will want to change these settings.
- Start the Internet Information Services (IIS) Manager.
- Choose the server from the left side list.
- Select the main server entry.
- Select the 'Application Pools' entry under the main server.
- Find and select the application pool for the website you are working with. (The default main site will be named 'DefaultAppPool'.)
Next, we want to edit the basic and advanced settings of the application pool.
Basic Settings
- Right-click the application pool and choose 'Basic Settings'.
- Change '.NET CLR version' to 'No Managed Code'. (Can leave this set if you need managed apps too.)
- Change 'Managed pipeline mode' to 'Classic'.
- Ensure 'Start application pool immediately' is checked.
Advanced Settings
- Right-click the application pool and choose 'Advanced Settings'.
- Change 'start Mode' to 'AlwaysRunning'.
- Change 'Identity' to a user that has proper permissions to execute the Node.js module from iisnode.
- (Optional) Change 'Idle Time-out (minutes)' to any desired time.
- Change 'Idle Time-out Action' to 'Suspend'.
- Change 'Maximum Worker Processes' to '1' if not already. (Depending on your type of site, you may need/want more.)
Next, you will need to obtain the needed node modules and bower packages for arcanus to run properly.
- Open a powershell terminal.
- Navigate to the arcanus folder in the new website.
- ie. cd C:inetpubyourwebsitearcanus
- Run the command:
npm install
- Run the command:
bower install
While iisnode does a great job hosting the arcanus framework and managing the node process(s) for us, it does have a small issue due to how application pools recycling work. IIS will automatically recycle the application and terminate/suspend it after a set idle timeout is reached. A method to help keep the site running and to initialize it immediately is called 'Application Initialization'. (This feature requires IIS 8.0 or higher to work!)
To make use of this feature, you must first install/enable it:
- Open the Windows Server Role Manager on the server.
- Choose 'Add Roles and Features'.
- Select the server you are editing.
- Select 'Server Roles' from the left list.
- On the right, local 'Web Server (IIS)' and open the sub-lists for it.
- Open the sub-lists for 'Web Server'.
- Open the sub-lists for 'Application Development'.
- Check 'Application Initialization' from the list.
- Complete the rest of the dialogs to install the new feature(s).
Once installed, we now need to configure the new feature.
Note: In order for this feature to work, your application pool MUST be set to AlwaysRunning as stated above in the setup steps.
- Start the Internet Information Services (IIS) Manager.
- Choose the server from the left side list.
- Select the main server entry.
- Select the website you are working on from the website list under the selected server.
- On the right-side, under the 'Actions' menu, select 'Advanced Settings'.
- Ensure that 'Preload Enabled' is set to true.
- Click 'OK' to save any changed options.
- On the websites features lists, select 'Configuration Editor' near the bottom.
- At the top of this editor, locate the 'Section' option.
- Navigate to 'System.WebServer'.
- Navigate to 'applicationInitialization' under the 'System.WebServer' list.
Here we need to alter the settings of the sites application initialization.
- Set 'doAppInitAfterRestart' to 'False'.
- Set 'remapManagedRequestsTo' to 'arcanus/app.js'
- Set 'skipManagedModules' to 'True'.
- Click 'Apply' at the top-right under 'Actions' to apply the new settings.
- Restart the entire IIS instance.
- On the left side, choose the main server hosting the website.
- On the right side, under 'Manage Server' click Restart.
After the server restarts, your node instances should automatically start now for that website.
For more information on Application Initialization, see: http://www.iis.net/learn/get-started/whats-new-in-iis-8/iis-80-application-initialization