Thursday, January 12, 2006

How to make RequestTimeout work

Here's another beginner tip for an issue that had me hunting around for over an hour (Doh!). Since CFMX, the cfsetting tag has had an attribute called "requesttimeout". It allows you to force a long running page to use a longer timeout in seconds than is set in the administrator. I've used the cfsetting tag a few times since CFMX came out and I just figured it was one of those things that seems to not work as I expect sometimes. The requesttimeout attribute of the cfsetting tag is supposed to override any value set in the ColdFusion Administrator.

The keyword in that last sentence is override. It does not act to actually enable the request timeout feature of cf. If you don't have the checkbox and a default value set in the administrator, the value you set with the cfsetting tag doesn't have anything to override.

Your mileage may vary on this next point, but it is what caused my confusion for the longest time. If you don't have the checkbox in the administrator selected, you might expect all of your requests to run until they finish. What I have found is that in most cases, timeouts get taken over by the webserver settings. In my case, IIS has a cgi request timeout value that seems to kick in if I don't have request timeouts enabled in cf.

4 comments:

  1. Good find. You should check livedocs and leave a comment there. Adobe is -very- good about reading those comments and updating the docs in future editions.

    ReplyDelete
  2. Thanks Ray, I'll make a note to do that once I make sure I'm actually correct. I'd like to test it on a few different webservers.

    (hope the 360 leaves you a little time to still work on your projects :D)

    ReplyDelete
  3. I always found this a little backwards since with <cfsetting showdebugoutput="yes/no"> the Administrator takes precedence, and with RequestTimeout the page takes precedence... but I digress.

    It's over two years later than this entry, and we're actually still using CF5. As it turns out, in CF5 the request timeout does NOT have to be checked within the Administrator in order for it to work. However, I'm not using cfsetting, but appending ?RequestTimeout=5 to the url since that's all that CF5 offers, so that may account for difference.

    ReplyDelete
  4. I've been searching for some time now to solve a problem. I'm converting/migrating data and it indeed is a long-running app. You're explanation of requesttimeout is very helpful. I have 2 other related problems you might have insight on. The CF/IIS server gets swamped in garbage collection. I broke the app down to run in parcels ( one loop for each company and all related data) and that seemed to help. I use requesttimeout=99999 just in case I have a particularly large company. But, sooner or later Firefox (and all others for that matter) detects a redirect loop and the process stops. I've changed the settings in about:config that I've found in research, but nothing will let me past the error.

    ReplyDelete