Chris Crowe's Blog
Ramblings of an IIS MVP ( MVP Since 1997 )

Powered By IIS 7

Search my blog

Some of my readers



My Microsoft Certifications


Dec 15, 1998

Dec 20, 2000

Jan 31, 2001

Jul 22, 2002

Nov 1, 2004

My Microsoft MVP Awards




1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
mvp.support.microsoft.com

On IIS 6.0 you will find that when you create web sites that their log files are created with seemingly random numbers. In previous versions of IIS the Instance IDs as they are called were sequentially numbered.

The first "Default Web Site" has a log file directory of W3SVC1 but any new sites you create may end up as follows (or something similar)

  • W3SVC1240841244
  • W3SVC1289352529
  • W3SVC147076792
  • W3SVC1527186048
  • W3SVC1566259604
  • W3SVC1710104836

I have written a script that you can use to display all the web sites and their associated Instance Ids - the output similar to the following.

Web Sites                    Description
===============================================================
W3SVC/1                   Default Web Site
W3SVC/1036328378 WebSite1
W3SVC/1816184000 WebSite2
W3SVC/1867813904 WebSite3
W3SVC/568530179   WebSite4
W3SVC/719499532   WebSite5
W3SVC/669732006   WebSite6

See http://blog.crowe.co.nz/archive/2005/12/08/346.aspx for the script.

Something I only learned recently was that the Instance Ids can be made sequential again by editing the registry and they are not random at all.

Changing the behaviour to the same as previous IIS versions

Remember : Editing the registry is a risk you take on your own shoulders.

To do this:

  1. Click Start, click Run. In the Open box, type regedit, and then click OK.
  2. In Registry Editor, locate the following key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\InetMgr\Parameters
  3. Click the Parameters key. On the Edit menu, click New Dword Value.
  4. Type IncrementalSiteIDCreation for the name.
  5. Double-click the name of the new value.
  6. Change Value Data to 1, and then click OK.
  7. To enable the change, restart the IIS services.

Note: When you remotely administer another IIS server, the value of the registry key of the local server is used to determine how the site identification number is generated on the remote server.

Why was it changed?

The reason that Instance ID were changed was that if you are running a Web Farm with multiple physical IIS servers and create a web site on each server with the same description all of the web sites will have the same Instance ID.

Basically if you create a new web site in IIS 6 and then delete the web site and create it again it will be created with the same Instance ID. So if you have multiple physical web servers for a particular web application you can read the log files from the same W3SVCx where x is the instance ID.

I created a web site with a description of XYZ and it produced the Instance ID of 906768 so my log file directory ended up as W3SVC906768

I then deleted this web site and the associated Log File Directory and repeated the exercise.

It indeed did create the same Instance ID of 90768

The following table shows some descriptions and Instance IDs

Description Instance ID Comment
A 66 ASCII character for B not A
B 67 ASCII character for C not B
AA 6631 No idea why 31 appears
AB 6632 No idea why 32 appears
AAA 669696 No idea why 96 appears

 

posted on Wednesday, May 03, 2006 11:27 PM | Filed Under [ IIS IIS / Tools / Administration IIS / Tools / Log Files ]

Comments


No comments posted yet.

Post Comment


Title *
Name *
Email
Url
Comment *  
Please add 2 and 7 and type the answer here: