PRB: "Script Time Out" Error in Active Server Pages (ASP) (268364)



The information in this article applies to:

  • Microsoft Active Server Pages
  • Microsoft Internet Information Server 4.0
  • Microsoft Internet Information Server 5.0

This article was previously published under Q268364

SYMPTOMS

When you attempt to run an Active Server Pages (ASP) page, you may receive the following error message:
Error Type:
Active Server Pages, ASP 0113 (0x80004005) The maximum amount of time for a script to execute was exceeded. You can change this limit by specifying a new value for the property Server.ScriptTimeout or by changing the value in the IIS administration tools.

CAUSE

The ScriptTimeout property specifies the maximum amount of time that a script can run before it is terminated. The error is generated when the processing time of the script exceeds the maximum value that has been designated for the ScriptTimeout property.

RESOLUTION

There are three ways to resolve this problem:
  • You can increase the time that is allowed to process ASP scripts for a particular Web site. To do this, change the metabase value in Internet Information Server (IIS):
    1. Open Internet Services Manager.
    2. Expand the tree and right-click Default Web Site (or the site that has the problem).
    3. Click Properties.
    4. Click the Home Directory tab.
    5. Under Application Settings, click Configuration.
    6. Click the App Options tab.
    7. Increase the ASP Script Timeout value to a number high enough to prevent script timeouts.
    -or-

  • You can increase the time allowed to process ASP scripts for all Web sites. To do this, change the metabase value in IIS:
    1. Open Internet Services Manager.
    2. Right-click the name of your computer.
    3. Click Properties.
    4. In Master Properties, select WWW Service, and then click Edit.
    5. Click the Home Directory tab.
    6. Under Application Settings, click Configuration.
    7. Click the App Options tab.
    8. Increase the ASP Script Timeout value to a number high enough to prevent script timeouts.
    -or-

  • You can use the Server.ScriptTimeOut property to programmatically increase the ScriptTimeOut property value at the page level in ASP. For example, if you want 3 minutes to pass before script processing times out, add the following line to the ASP page:
    Server.ScriptTimeout = 180
    					
    NOTE: When you set the script timeout at the page level, you cannot set it to less than the metabase value in IIS (90 seconds by default). However, you can set the script timeout value higher than the metabase value. For example, if you don't change the metabase default, and you code the following:
    Server.ScriptTimeout = 20
    					
    the ScriptTimeOut value is 90. If you code the following:
    Server.ScriptTimeout = 120
    					
    the ScriptTimeOut value is 120.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Open Internet Services Manager.
  2. Expand the tree and right-click Default Web Site (or the site on which you want to reproduce this problem).
  3. Click Properties.
  4. Click the Home Directory tab.
  5. Under Application Settings, click Configuration.
  6. Click the App Options tab.
  7. Set the ASP Script Timeout to 5.
  8. Create a new ASP page with the following code in the Head section:
    <%
    EndTime = Now() + (10 / (24 * 60* 60))  '10 seconds
    Do While Now() < EndTime
      Response.Write ". "
    Loop
    %>
    					
  9. View the ASP page in the browser.
NOTE: An increase in timeout value can have a negative effect on server performance. You should design scripts that run within the default timeout settings. For example, an increase in script timeout value can keep IIS threads occupied and reduce the number of users that the server can serve.

REFERENCES

For additional information, click the article number below to view the article in the Microsoft Knowledge Base:

182036 HOWTO: Use MTS to Trap Error 'ASP 0113' Script Timed Out


Modification Type:MinorLast Reviewed:7/15/2004
Keywords:kbASPObj kbprb KB268364