• IIS Admin Blog

  • How To Configure the CGI Script Timeout Value in IIS 5.0 and 6.0

7th September 2007

How To Configure the CGI Script Timeout Value in IIS 5.0 and 6.0

posted in IIS 6.0 |

Then select CGITimeout from the ID drop-down menu and enter the required value in the Data field. In this example I have set a CGITimeout value of 600 seconds on web site ID 4

Fig. 6

If we now look at the properties of the relevant web site using Metaedit we can see that the CGITimeout value for web site 4 does indeed show a value of 600 seconds.

Fig. 7

The third method of configuring the CGI Timeout value at the Web Site level in IIS 5.0 is to use the built-in IIS Administration Scripts. These are located by default in C:\Inetpub\AdminScripts.You can find out more about the IIS 5.0 Administration Scripts here :

http://www.microsoft.com/windows2000/en/server/iis/

To configure the CGI Timeout metabase property I am going to use the IIS Administration Script Utility AdsUtil.vbs. You can see examples of how to use this script here :

http://www.microsoft.com/windows2000/en/server/iis/htm/adminsamples/adsutil.htm

In this example I am going to set the CGITimeout value on web site ID 3 to 1600 seconds. So starting at C:\Inetpub\AdminScripts from the command prompt I type the following command :

cscript adsutil.vbs set w3svc/3/CGITimeout “1600” 

Fig. 8

We can confirm that this value has been set by either typing the command “cscript adsutil.vbs get w3svc/3/CGITimeout” (as shown above) or by browsing to the appropriate location in the metabase using Metaedit.

Configuring the CGI Timeout Value in IIS 6.0

The online documentation for IIS 6.0 states that,

“Setting the timeout value for a CGI application involves manually setting the CGITimeout metabase property.”

http://technet2.microsoft.com/WindowsServer/en/Library/3af4a050-2c60-426c-b28e-83de7e3683e91033.mspx

For reasons best known to themselves Microsoft decided to remove the option to configure the CGI timeout value in IIS 6.0 from the GUI interface. This is probably one of the reasons why some people have difficulty configuring CGI applications on IIS 6.0 – its also the main reason for me writing this short tutorial

Even though you cannot configure the CGI timeout value using the GUI in IIS 6.0 it is still possible to exert a fine level of granular control using either the Metabase Explorer utility or the IIS 6.0 Command Line Administration Scripts. Interestingly, the online documentation comments that,

“The CGITimout property can be set at a global level and at the individual site and site element levels. This gives you the flexibility to configure an overall CGITimeout level, and then customize the setting for individual sites and site elements.”

What this actually means is that you can configure the CGI timeout value down to the individual file level in IIS 6.0 – this is really useful because it means that if you had one specific long-running form, for example, you could configure a higher value in the metabase for that particular form to allow it to run for longer without allowing all other CGI scripts to run for the same length of time. The CGITimeout Metabase Property is documented here :

http://technet2.microsoft.com/WindowsServer/en/Library/5c842c92-78ed-4422-8b9d-534693e866811033.mspx

Apparently, it is possible to configure a maximum CGI timeout value of 2.1 million seconds !! If your CGI scripts need to run for that long I’d suggest you seriously need to think about optimising your code 😉

Perhaps the simplest method of configuring the CGI Timeout value (or indeed any metabase property) in IIS 6.0 is to use the Metabase Explorer tool from the IIS 6.0 Resource Kit. You can download the IIS 6.0 Resource Kit tools here : http://support.microsoft.com/kb/840671

In this example I have created a Web Site in IIS 6.0 called ‘Perl’ which has a site ID of W3SVC83136308. The Web Site also contains a Virtual Directory called ‘CGI Scripts’ in which there are two files – ‘Orders.pl’ and ‘Search.pl’.

Fig. 9 

In order to demonstrate the two different methods, what I am going to do is use Metabase Explorer to configure a CGI timeout value of 600 seconds at the directory level for the Virtual Directory ‘CGI Scripts’ and then use the Command-Line Administration Scripts to apply a unique timeout value of 1800 seconds at the file level, specifically for the file named ‘Search.pl’.

Start by opening up Metabase Explorer and navigating to the entry for the ‘CGI Scripts’ virtual directory under the ‘Perl’ web site ID (see above). Right-click on the ‘CGI Scripts’ virtual directory entry and click New, DWORD. Then select the CGI Timeout Record Name or Identifier from the drop-down menu as shown here.

Fig. 10

Pages: 1 2 3

This entry was posted on Friday, September 7th, 2007 at 3:16 pm and is filed under IIS 6.0. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

There is currently one response to “How To Configure the CGI Script Timeout Value in IIS 5.0 and 6.0”

Why not let us know what you think by adding your own comment! Your opinion is as valid as anyone elses, so come on... let us know what you think.

  1. 1 On February 28th, 2012, James Collett said:

    This article was a great help, despite its having been published 4 and a half years ago! The command line method of changing the CGI Timeout on IIS was exactly what we needed, not wanting to instal a downloaded snap-in on a production machine.

    Thanks!

Leave a Reply

You must be logged in to post a comment.

  • Calendar

  • October 2017
    M T W T F S S
    « Sep    
     1
    2345678
    9101112131415
    16171819202122
    23242526272829
    3031