Quantcast
Channel: Installation and Setup
Viewing all articles
Browse latest Browse all 631

IIS / Asp.net AlwaysRunning settings not working.

$
0
0

Hi there,

We have an Asp.Net 4.5.1 Mvc 5 web app written in VS2013, and hosted on a Windows Server 2012 with IIS8.  The Mvc app calls 4 separate WebApis, also hosted on the same server in IIS8.  So in total I have 5 websites in IIS, each running in its own Application pool.

When the first user hits any page of the Mvc app, or, after a user hits the app after it has been dormant for several minutes, the first page is taking up to 10 seconds to load.  If I then close the page down and re-open it immediately, it will fire up almost instantly.  Then I close it down and leave it for 10 mins or so, and it will be slow on the subsequent load.

The same code runs on every occasion that the first page is hit (i.e. I’m not doing anything that takes a long time to load and then caching for subsequent requests).

Anyway, my understanding is that to fix this, I need to set each Application pool to startmode = “AlwaysRunning”, and the websites to have preloadEnabled = “true”, as per this article http://blogs.iis.net/wadeh/archive/2012/05/01/application-initialization-part-2.aspx.  I have made these changes (pasted from applicationHost file below), yet the Mvc app still behaves exactly as before – slow on initial load.  I have opened task manager, and can see that there are 5 w3wp.exe processes running with User name listed as per the sites/applicationsPools.

Can you please point me in the right direction to resolve this.

Thanks

Ben

 

 

 

  <applicationPools>

            <add name="DefaultAppPool" />

            <add name="SecurityWebApi" autoStart="true" startMode="AlwaysRunning" />

            <add name="Classic .NET AppPool" managedRuntimeVersion="v2.0" managedPipelineMode="Classic" />

            <add name=".NET v2.0 Classic" managedRuntimeVersion="v2.0" managedPipelineMode="Classic" />

            <add name=".NET v2.0" managedRuntimeVersion="v2.0" />

            <add name=".NET v4.5 Classic" managedRuntimeVersion="v4.0" managedPipelineMode="Classic" />

            <add name=".NET v4.5" managedRuntimeVersion="v4.0" />

            <add name="EmailWebApi" startMode="AlwaysRunning" />

            <add name="LandChargesWebApi" startMode="AlwaysRunning" />

            <add name="LandChargesMvc" startMode="AlwaysRunning" />

            <add name="NLISWebApi" />

            <add name="DigitalMediaWebApi" startMode="AlwaysRunning" />

            <add name="DigitalMediaMvc" startMode="OnDemand" />

            <add name="EmailMvc" />

            <applicationPoolDefaults managedRuntimeVersion="v4.0">

                <processModel identityType="ApplicationPoolIdentity" />

            </applicationPoolDefaults>

        </applicationPools>

 

<sites>

            <site name="Default Web Site" id="1">

                <application path="/">

                    <virtualDirectory path="/" physicalPath="%SystemDrive%\inetpub\wwwroot" />

                </application>

                <bindings>

                    <binding protocol="http" bindingInformation="*:80:" />

                </bindings>

            </site>

            <site name="SecurityWebApi" id="2">

                <application path="/" applicationPool="SecurityWebApi" preloadEnabled="true">

                    <virtualDirectory path="/" physicalPath="C:\inetpub\SecurityWebApi" />

                </application>

                <bindings>

                    <binding protocol="http" bindingInformation="*:9999:" />

                </bindings>

            </site>

            <site name="LandChargesWebApi" id="4">

                <application path="/" applicationPool="LandChargesWebApi" preloadEnabled="true">

                    <virtualDirectory path="/" physicalPath="C:\inetpub\LandChargesWebApi" />

                </application>

                <bindings>

                    <binding protocol="http" bindingInformation="*:9997:" />

                </bindings>

            </site>

            <site name="LandChargesMvc" id="5">

                <application path="/" applicationPool="LandChargesMvc" preloadEnabled="true">

                    <virtualDirectory path="/" physicalPath="C:\inetpub\LandChargesMvc" />

                </application>

                <bindings>

                    <binding protocol="http" bindingInformation="*:9499:" />

                </bindings>

            </site>

            <site name="NLISWebApi" id="6">

                <application path="/" applicationPool="NLISWebApi">

                    <virtualDirectory path="/" physicalPath="C:\inetpub\NLISWebApi" />

                </application>

                <bindings>

                    <binding protocol="http" bindingInformation="*:9996:" />

                </bindings>

            </site>

            <site name="DigitalMediaWebApi" id="7">

                <application path="/" applicationPool="DigitalMediaWebApi" preloadEnabled="true">

                    <virtualDirectory path="/" physicalPath="C:\inetpub\DigitalMediaWebApi" />

                </application>

                <bindings>

                    <binding protocol="http" bindingInformation="*:9995:" />

                </bindings>

            </site>

            <site name="DigitalMediaMvc" id="8">

                <application path="/" applicationPool="DigitalMediaMvc">

                    <virtualDirectory path="/" physicalPath="C:\inetpub\DigitalMediaMvc" />

                </application>

                <bindings>

                    <binding protocol="http" bindingInformation="*:9498:" />

                </bindings>

            </site>

            <site name="EmailMvc" id="9">

                <application path="/" applicationPool="EmailMvc">

                    <virtualDirectory path="/" physicalPath="C:\inetpub\EmailMvc" />

                </application>

                <bindings>

                    <binding protocol="http" bindingInformation="*:9497:" />

                </bindings>

            </site>

            <site name="EmailWebApi" id="3">

                <application path="/" applicationPool="EmailWebApi" preloadEnabled="true">

                    <virtualDirectory path="/" physicalPath="C:\inetpub\EmailWebApi" />

                </application>

                <bindings>

                    <binding protocol="http" bindingInformation="*:9998:" />

                </bindings>

            </site>

            <siteDefaults>

                <logFile logFormat="W3C" directory="%SystemDrive%\inetpub\logs\LogFiles" />

                <traceFailedRequestsLogging directory="%SystemDrive%\inetpub\logs\FailedReqLogFiles" />

            </siteDefaults>

            <applicationDefaults applicationPool="DefaultAppPool" />

            <virtualDirectoryDefaults allowSubDirConfig="true" />

        </sites>


Viewing all articles
Browse latest Browse all 631

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>