Brook, On Tue, May 17, 2011 at 10:56 AM, Brook Davies <cft...@logiforms.com> wrote:
> I am considering spawning a new thread via the onRequestEnd event to do > some > post processing. Basically its going to record some stats (a couple quick > DB > queries) and possibly send an email based on some criteria. I am > considering > CFTHREAD because the user does not need to wait for any results of this > processing. > > I've read some things about CFTHREAD being a bottle neck and that CF > Proffesional has limited threads. Would I be asking for trouble trying to > do > this? Should I just let the user wait for the processing to finish? It > would > really like only be 100-200 milliseconds or so > This is really one of those situations where running a load test really gives you the best answer. You may end up getting a variety of answers, but none will be quite as useful as spending 30-60 minutes running a simple load test to see what happens. If you don't currently have any tools for running a load test, download Apache jMeter <http://jakarta.apache.org/jmeter/> and then you can follow this tutorial: http://www.roseindia.net/jmeter/using-jmeter.shtml Set up a simple test what the results are between using <cfthread /> and not using it in your onRequestEnd and see what the impact is on your site under various types of load. If you set up the Aggregate Report listener it'll give you an idea of the overall impact. I use jMeter a lot when I want to quickly see what the real impact of under load of some code might be. I usually will set things up so that a URL parameter can toggle various code branches--that way I can quickly change the behavior right from jMeter. I'll run several tests simulate heavy load and see which performs better overall and to see if any of the solutions are causing weird queuing issues. -Dan -- Dan G. Switzer, II dswit...@pengoworks.com 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:344576 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm