ActivityTimeout
March 12th, 2009 Posted in iisI’ve been trying to get another website I manage to allow me to upload files (usually around 40MB) via the browser so I don’t have to open up FTP. The problem, I’ve been having is something has been going wrong and the upload fails. Naturally, no real or useful error message is given.
Here’s my setup: IIS7, PHP 5 (using FastCGI). When I would click the “Upload” button from the webpage, things would chug along and eventually fail. The only thing the browser would say is that the connection had been reset – which tells me nothing. Did my ISP have a hiccup? Did the server shutdown? Pretty useful, eh?
After trying everything I could find on Google, I tried the simple thing: I changed the ActivityTimeout under FastCGI Settings. This is defaulted to 120. Basically, this says that if the php-cgi.exe process doesn’t talk to IIS for two minutes, timeout. Well, while the PHP process is processing my upload (the verb IIS uses is “POST”), it seems that it doesn’t talk to IIS, so IIS times it out. Well, you try uploading a 40MB file from some DSL site in the world and see if you can do it in two minutes. I know I can’t. I changed the timeout to 600 seconds, and now I’m happily uploading files.
I suppose this could be dangerous if PHP hangs and the process gets stuck. It might make users wait 10 minutes if something screws up. I suppose I’ll tackle that issue if it comes up.