ColdFusion page timeouts and scheduled tasks

This post is more than 2 years old.

Thanks to Micah Brown for checking into this. He emailed me a few days ago with an interesting question. Given that your server may be set to timeout requests after 10 seconds, will the timeout in the settings of your scheduled task override it? When he asked this, I simply told him what I'd do. Set your server timeout setting to a nice low number, like 10, set your scheduled task to a higher number, like 20, and then drop in a simple sleep() command in your CFM:

<cfset sleep(15000)>

He tested it... and yes - the setting in your scheduled task can override the server-side setting. I'll also remind people that outside of scheduled tasks, you can also use the cfsetting tag to override the setting.

Raymond Camden's Picture

About Raymond Camden

Raymond is a senior developer evangelist for Adobe. He focuses on document services, JavaScript, and enterprise cat demos. If you like this article, please consider visiting my Amazon Wishlist or donating via PayPal to show your support. You can even buy me a coffee!

Lafayette, LA

Archived Comments

Comment 1 by Jim Horner posted on 7/3/2012 at 7:09 PM

Wow, Has it finally happened? I never thought I would see the day:

So if CF is unavailable, does that mean we all have to start learning PHP or something??? LOLOLOL!!! No, but seriously that is somewhat amusing.

Comment 2 by Raymond Camden posted on 7/3/2012 at 8:33 PM

Heh, I forget who set that up.

Comment 3 by Rick Mason posted on 7/3/2012 at 9:48 PM

Well it is super embarassing cause the domain is registered to Adam Lehman. Ray, could you ping him before this reaches Twitter?

Comment 4 by Raymond Camden posted on 7/3/2012 at 9:51 PM

I'm not sure I'd call this "super embarrassing", but I'll ping him. I forgot it was him.

Comment 5 by Larry C. Lyons posted on 7/4/2012 at 12:22 AM

even better I get this when I try to go there:

Service Unavailable

Comment 6 by David posted on 7/4/2012 at 6:52 PM

What about using the ?requesttimeout=xxx option for your scheduled tasks, if you know they have a tendency to timeout.

Comment 7 by Raymond Camden posted on 7/4/2012 at 6:57 PM

That's an option too. Personally, I'd use the setting in the tsk, or cfsetting, but it's just a preference.

Comment 8 by Jordan 4 Fire Red 2012 posted on 7/18/2012 at 12:58 PM

The Great Recession has come and gone. Well, at least according to economists. http://www.foampositeforsal... Cheap foamposites
http://www.jordan4firereds.... Jordan 4 Fire Red

Comment 9 by Axel posted on 5/12/2013 at 6:53 PM

While this is an old post, it is still an open question for many. After a few tests, we found out that scheduled tasks have a default timeout of approximately 5 minutes --- independent of the settings in the CF Admin SETTINGS page!!!

After setting the timeout inside the task manager our process, which takes about 7 Minutes, ran through with no problem.