Mosh,

> Thanks for the reply.  In the past, I've always done things via the
> route you suggested (a single task working off of a queue).  My
> concern here, and it looks like I left this out of the original post,
> is that the tasks will be time-sensitive (but not time-critical).
> That is, if the task is set to run at 5:00 PM, it should run as close
> to 5:00 PM as possible (think calendar alert "sensitive" vs. giving
> someone scheduled medicine "critical").

You might want to consider running these scheduled tasks on a separate 
CF instance--that way the threads tied up by background tasks are going 
to be tying up threads of your visitors.

Some other things you could try:

1) Run the background task every 60 seconds. If there are no tasks to 
run the overhead should really be essentially nil (you should only be 
dealing with a few milliseconds for any empty queue query.)

2) Use <cfthread /> to process multiple background tasks asynchronously. 
That way a single long running task won't bog down all the tasks 
scheduled to run on the current iteration.

3) Run multiple scheduled events (this might be better if you're running 
a separate instance for scheduled tasks.) You can assign tasks in a 
round robin fashion, so each background script would run a different set 
of tasks.

4) Do an asynchronous HTTP request to process the task. This is a good 
way to just trigger off a bunch of requests to be processed that will 
start right away. However, I'd only do this if you're running a separate 
instance for scheduled tasks.

-Dan

-- 
Dan G. Switzer, II
[email protected]
http://blog.pengoworks.com/

█▀▀▀▀▀█ ▄▀ ▄█▄▄█  █▀▀▀▀▀█
█ ███ █ ▀███▀ █▀  █ ███ █
█ ▀▀▀ █ █▄ ▄  ▀██ █ ▀▀▀ █
▀▀▀▀▀▀▀ █▄▀ █ █ ▀ ▀▀▀▀▀▀▀
█▀▄█▄▄▀▀  █▄▀██ █▄█▀▀ ▀▀▄
  ▄▀█▄▀▀▀▄▀▀▄▄▄█ ▄█▄▀▀  ▀▀
▀▀▄▄▀▀▀▀█▄▄▀▀█ ▀▀██▄ █▄▀█
▀▄ ▄▀ ▀  ▀▀█▄█▄▄▄ █▄▀▄▀▄▀
▀▀ ▀▀ ▀ █▀ ██▄ ▄█▀▀▀███ ▄
█▀▀▀▀▀█ ▀▄█ ▄▀█▀█ ▀ █▄▄▀█
█ ███ █ ▄▀▀ █▀ ▄▀█▀██ ▄▀
█ ▀▀▀ █ ▄ █▄ ▄▄ ▄▄▄ ▀█▀ ▀
▀▀▀▀▀▀▀ ▀▀  ▀▀ ▀▀  ▀   ▀▀

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345023
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to