IIS 7.5 Application Initialization for ASP.NET web service (warmup) without remapping requests

I’m trying to use the IIS 7.5 Application Initialization extension to configure a warmup process for my web application. This is an approach I am taking to minimize slow downs caused by application pool recycling, which is a problem explained well in other questions on Stack Overflow.

What I would like, is to gain the benefits of application initialization, without remapping requests anywhere else.

What I’ve done so far

I followed the IIS 8 instructions for the basic use case, and it works great! I created a splash page called app_starting.htm and by using this code, it gets displayed while the app initializes:

<applicationInitialization remapManagedRequestsTo="app_starting.htm" skipManagedModules="true" >
    <add initializationPage="/" />
</applicationInitialization>

Why this isn’t good

I want to use initialization to speed up requests to a REST-based web service written using ASP.NET MVC. This web service is a backend for several applications. When they make a request to a resource (i.e. /client/1/addresses), they can’t handle receiving a splash page instead.

What I’ve tried

I removed the remapManagedRequestsTo attribute. However, now when I request a resource during initialization, I get a 500 error until initialization is completed. After which, responses go back to normal. The applications which rely on this this service also wouldn’t respond well to a 500 error, since initialization should not be an error condition.

What I need

Without performing any remapping, I expect the request behavior to go back to normal. Even if initialization is in progress, other requests to the application should be queued and wait until after initialization has completed.

Is there something I am missing? Can I accomplish this?

Thanks for the help!

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

I think I answered my own question. I removed the skipManagedModules attribute and it worked. This code accomplishes application initialization, and during warmup, requests seem to wait for it to complete before being processed:

<applicationInitialization>
    <add initializationPage="/" />
</applicationInitialization>

I couldn’t find any documentation for why it behaves this way and don’t really understand what skipManagedModules means. If anyone can further explain this, I can mark the explanation as an answer. Thanks!


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x