Showing posts with label IIS. Show all posts
Showing posts with label IIS. Show all posts

Tuesday, August 12, 2014

Server Configuration

FILE
PATH
DESCRIPTION
machine.config
%windir%\Microsoft.NET\Framework\\config\
Contains most of the .NET Framework sections and settings.
web.config (root)
%windir%\Microsoft.NET\Framework\\config\
Contains more of the ASP. NET-specific sections and settings.
applicationHost.config
%windir%\System32\inetsrv\config (by default)
Contains the IIS global web server, configuration sections, and site settings using location tags.
administration.config
%windir%\System32\inetsrv\config (by default)
Contains the configuration for IIS Manager and the IIS Manager users.
redirection.config
%windir%\System32\inetsrv\config
This is used for shared configuration, which allows applicationHost.config and administration.config to be relocated.

Sunday, August 3, 2014

Web Capacity Analysis Tool (WCAT)

This tool comes very handy if you want to check some specific page level performance w.r.t requests processed in IIS.

Say for e.g, you want to check response time of any page as compared to baseline response time this tools comes as a quick rescue.

Download Tool

http://www.iis.net/downloads/community/2007/05/wcat-63-(x86)

Steps to run this tool.
http://blogs.msdn.com/b/alikl/archive/2008/03/09/stress-test-asp-net-web-application-with-free-wcat-tool.aspx

http://www.iis.net/learn/manage/managing-performance-settings/walkthrough-iis-output-caching

I find this very useful when you don't have to configure heavy duty software , server to just test simple or troubled page.





 

Monday, July 28, 2014

Url Rewrite: Check Request URL Best Practice


Append or Remove the Trailing Slash Symbol



Enforce Lowercase URLs


Checking If a Request Is for a File or a Directory

Using String Functions with Rule Actions and Conditions


Add a note hereURL Rewrite offers three string functions that can be used with the rule actions and conditions:

·         Add a note hereToLower — Returns the string as lowercase.

·         Add a note hereUrlEncode — Returns the string as a URL-encoded format.

·         Add a note hereUrlDecode — Returns the string as a decoded string.

Friday, July 18, 2014

Http.sys Cache · UriScavengerPeriod. Default value: 120 seconds.

· UriScavengerPeriod. Default value: 120 seconds.

Important Registry Setting for production IIS web server environment.
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Http\Parameters


Below description do not belong to me..

I referred below blog :
http://performance-expert.blogspot.se/2012/06/high-performance-websites-stanford.html

The http.sys cache is periodically scanned by a scavenger, and entries that are not accessed between scavenger scans are removed. Setting the scavenger period to a high value reduces the number of scavenger scans. However, the cache memory usage might increase because older, less frequently accessed entries can remain in the cache. Setting the period too low causes more frequent scavenger scans, and it can result in too many flushes and cache churn

IIS Performance Tuning : allowSubDirConfig="false"

As a best practice , never allow nested web.config for single website. Avoid using multiple web.config as applicationhost.config try to make traversal search to locate web.config. As a best practice there should be one web.config.

Changes in Applicationhost.config 
    
     
    
            
    

        
    
 
Remove unnecessary module such windows authentication , if web site is open to all web users.

Thursday, July 10, 2014

IIS8.0 Asp.net Warmup

    AddRoleFeature
  1. Introduction
  2. Prerequisites
  3. Create Your Warmup Script Assembly
  4. Application Pool: Demo Website
  5. IIS Web Server: Configuration Editor
  6. system.applicationHost/applicationPools
  7. system.applicationHost/ServiceAutoStartProviders
  8. system.applicationHost/Sites
  9. Application Initialization
  10. Final Step: Now Run this animal
  11. Reference

Introduction

I've been working on IIS asp.net warm up thing for quite sometime and I tried all possible ways to get my warm up script working but it failed to initialized and auto start. After spending some time understanding some of the flow and internal mechanism of request flow, we able to crack the solution. This article will somewhat help you find the resolution to most common problem that we may have to tackle when enabling warmp script in IIS. I started looking few articles around IIS7.5 and auto start app pool but hardly find the resource online to give me crisp and clear steps to enable this.The overall intent of this article is to provide the end to end steps and some known issues that one would run into.There is sample demo code one can download to setup warmup thing for your website. I haven't gone to extend to explain why we need IIS asp.net warmup however I covered the most likely configuration settings that would go into running the warm up script.

Prerequisites

The Application Initialization feature requires IIS 8.0 to be installed. In addition, the Application Initialization feature within the IIS "Application Development" sub-feature needs to be installed. The following screen shot from the Windows Server 2012 Server Manager UI shows the Application Initialization feature. IIS 8.0 Application Initialization Setup Key Note: Restart server to effect above changes. This initialization plays important role when we have to execute any startup page automatically without users access any web pages. Sometimes warmp up fails to start because there is some setting that needs to be enabled under [code] applicationInitialization[/code]



Create Your Warmup Script Assembly



This warmp script will be executed at the start up of IIS app pool recylce or at time of website initialization. There can be various scenario we can embed in this start up script.Like we can have warm up script for Caching web pages or getting ready canned reports or any heavy task which takes longer time to load.For demo purpose I kept the code setup simple, to just create folder + file. Remember never have such filesystem read write operation withing website virtual directory or website directory it results in application app pool recycle everytime the filewrite operation takes place.

Application Pool: Demo Website

Enable Start Mode="Always running" from OnDemand Mode


IIS Web Server: Configuration Editor

Go to Main Application IIS Root. select Configuration Editor. Changing applicationhost.config is much safer through configuration editor than doing it manually.

system.applicationHost/applicationPools

Click on collection to proceed. Ensure highlighted property are set as given below in the screenshot.

Check AutoStart mode=true

Check StartMode mode=AlwaysRunning

system.applicationHost/ServiceAutoStartProviders

Click on collection to proceed. Ensure highlighted property are set as given below in the screenshot.


Add Assembly and class reference warmup script pacakage in ApplicationHost.config ServiceAutoStartProviders tag. We've indicated this provider with name say PreWarmUpMyCache- Mind it- MY. Next we need to provide this reference to site tag in configuration as next step. Remember type=Assembly Full Name.ClassName,Assembly Full Name


system.applicationHost/Sites

Click on collection to proceed. Ensure highlighted property are set as given below in the screenshot.
Set ServerAutoStart=true

Set preLoadEnabled=true
Set serviceAutoStartEnabled=true
Set serviceAutoStartProvider=PreWarmUpMyCache





Application Initialization

Troubleshooting 1:Ensure your assembly is compiled and exists in bin folder of website.
Troubleshooting 2:Worst case even if warmup script not called ,try including default web page access auto initialize.Refer screenshot.

Final Step: Now Run this animal

Sample Code is attached for demo purpose. Download it and apply above setting to test run the demo.

References

IIS Auto Start Warm up By Scott Guthrie IIS Tech net


Wednesday, April 3, 2013

IIS Log and Http.sys Tips and Tricks



why can't I see IIS logs written immediately after a request?

The anwer is that the HTTP.SYS buffers the IIS logs and flushes to the disk every 60 seconds because of performance issues.

If you are running IIS 7.0 or IIS 7.5 and if you want to flush the HTTP.SYS buffer to the disk immediately, you can open a command prompt and run the following command:

netsh http flush logbuffer

http://blogs.msdn.com/b/amb/archive/2011/12/06/why-does-not-iis-log-requests-immediately.aspx