MonkeyMagix
MonkeyMagix

Reputation: 707

Server.ScriptTimeout = 0 Not working

I have an ASP Classic script that has to do a lot of things (admin only) including running a stored proc that takes 4 mins to execute.

However even though I have

Server.ScriptTimeout = 0

Right at the top of the page it seems to ignore it - 2003 and 2012 servers.

I have tried indexing the proc as much as possible but its for a drop down of commonly searched for terms so I have to clean out all the hacks, sex spam and so on.

What I don't understand is why the Server.ScriptTimeout = 0 is being ignored.

The actual error is this and comes just

Active Server Pages error 'ASP 0113'

Script timed out

/admin/restricted/fix.asp

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.

It never used to do this and it should override the default set in IIS of 30 seconds.

I have ensured the command timeout of the proc is 0 so unlimited and it errors AFTER coming back from the proc.

Anybody got any ideas?

Upvotes: 1

Views: 4028

Answers (1)

Keith
Keith

Reputation: 21224

0 is an invalid value for Server.ScriptTimeout for 2 reasons:

  1. ASP pages have to have a timeout. They cannot run indefinitely.
  2. ScriptTimeout can never be lower than the AspScriptTimeout set in IIS according to this statement from the MSDN docs:

For example, if NumSeconds is set to 10, and the metabase setting contains the default value of 90 seconds, scripts will time out after 90 seconds.

The best way to work around this is to set Server.ScriptTimeout to a really high value.

Upvotes: 5

Related Questions