DotNetCurry Logo

Deploying your MVC app and Monitoring Requests on IIS

Posted by: Suprotim Agarwal , on 5/31/2013, in Category ASP.NET MVC
Views: 40048
Abstract: A quick refresher of how to deploy ASP.NET MVC sites to IIS using Web Deployment Wizard and use the IIS request monitoring tool to nail down slow requests

IIS has built in monitoring tools that can be leveraged to monitor site performance and bottlenecks. Today we’ll deploy our code sample from the Async Await article I wrote some time back and see what kind of performance characteristics we can extract out of it.

This article uses Visual Studio 2012/2013.

 

Deploy an ASP.NET MVC App to IIS

Step 1: To get started, first thing we have to do is start Visual Studio in Administrator Mode.

Step 2: Now from the Solution Explorer right click and select “Publish Web Site”

web-publish-step-1

Step 3: Select New Profile and give a name

profile-name

Step 4: Next setup the Publish Method as Web Deploy, provide the server name, this can be a non-development system also; the Site Name, whether it’s the root site or a sub-site of the root site. Click Validate connection to validate.

web-publish-step-2

The next two steps are optional and you can hit Publish here itself. But let’s walk through the steps.

Step 5: Here I have unchecked the ‘User this connection string…” checkbox. This runs an additional transform apart from the default deployment transform that is executed on web.config, web.debug.config etc.

Click next or Publish from here.

mvc-publish-step2

Step 6: If you click next, you get an opportunity to see the changes being deployed. For first deployment it’s everything, thereafter only the changes are deployed.

determine-changes-step

Once you hit Publish, monitor the Output Window till the Build Succeeded and Publish Succeeded messages appear.

publish-succeeded

Deployment successful.

Monitoring Long Running Requests with IIS

To monitor requests on IIS, start the IIS Manager. From the Run dialog you can type in inetmgr to launch it. Once up, select the root node of the Connection tree on the left and check if you have ‘Worker Processes’ under IIS installed

iis-worker-processes

If not, use the Web Platform Installer to install it. Once installed, double click on it to go to Worker Processes frame.

view-current-requests

Select the ‘View Current Requests’ link on the right or double click the correct application pool in the middle.  Navigate to the main application and watch the Requests grow. If you take a closer look, this is a first time load of jQuery, MiniProfiler and Modernizer libraries are loading, hence the issue.

long-running-request

 

Once the load is complete, refresh the browser, nothing is visible in Requests list because nothing is taking as much time anymore. To test again, reset IIS, reload browser and navigate again. Conversely, you can start load the website with one of the load testing tools around stressing out the APIs to check which one is a bottle neck on load.

Conclusion

We had a quick refresher of how to deploy to IIS using Web Deployment Wizard. Thereafter we saw how (to obtain and) use the IIS request monitoring tool to nail down slow requests. That’s a wrap for the day, we’ll investigate more administration tools in the coming days.

Was this article worth reading? Share it with fellow developers too. Thanks!
Share on LinkedIn
Share on Google+
Further Reading - Articles You May Like!
Author
Suprotim Agarwal, MCSD, MCAD, MCDBA, MCSE, is the founder of DotNetCurry, DNC Magazine for Developers, SQLServerCurry and DevCurry. He has also authored a couple of books 51 Recipes using jQuery with ASP.NET Controls and a new one recently at The Absolutely Awesome jQuery CookBook.

Suprotim has received the prestigious Microsoft MVP award for nine times in a row now. In a professional capacity, he is the CEO of A2Z Knowledge Visuals Pvt Ltd, a digital group that represents premium web sites and digital publications comprising of Professional web, windows, mobile and cloud developers, technical managers, and architects.

Get in touch with him on Twitter @suprotimagarwal, LinkedIn or befriend him on Facebook



Page copy protected against web site content infringement 	by Copyscape




Feedback - Leave us some adulation, criticism and everything in between!
Comment posted by Chandan Kumar Panda on Monday, June 3, 2013 8:04 AM
Thanks Suprotim Agarwal.Very much helpful post.

I would appreciate you to post something about logging(errors) in ASP.NET - MVC with a complete demo.

will be waiting for your reply
Thanks
Chandan
Comment posted by vidhatafoils on Friday, June 7, 2013 8:00 AM
Thanks for sharing fabulous information.It' s my pleasure to read it.I have also bookmarked you for checking out new posts.
http://www.vidhatafoils.com