What I see is that the server load remains pretty consistent, it's the number of requests completed that is dropping. This could be an indication that the pages become more complex as the process continues, or it may indicate that the faster running threads are all completed leaving the longer running threads at the end. My suggestion would be to do some time monitoring on the loops. I think you'll find that the average completion time for each thread increases as the number of completed requests decreases.
David Phelan Web Developer IT Security & Web Technologies Emerging Health Montefiore Information Technology 3 Odell Plaza, Yonkers, NY 10701 914-457-6465 Office 862-234-9109 Cell dphe...@emerginghealthit.com www.emerginghealthit.com www.montefiore.org -----Original Message----- From: Money Pit [mailto:websitema...@gmail.com] Sent: Friday, July 26, 2013 12:41 PM To: cf-talk Subject: cfthread execution slowdown I need another set of eyeballs on this. I can't see what I'm doing wrong. I'm building many thousands of static pages. I turned to cfthread to speed things up. Each thread can output one page or more than one depending on info retrieved. I use an array to manage the number of threads in use at any one time. It works great, but I am seeing CF slow down - in fixed stages - throughout the life of the process. Take a look at this image taken from FusionReactor to see what I mean: http://205.210.189.205/images/screenshot081.jpg Its not a curve but rather three distinct stages of output. Stage 1 is about 2900 pages per minute, Stage 2 is around 2400 and Stage 3 - where the routine stabilizes - is about 1200. On a second server building differently-composed pages, I see exactly the same thing. CF isn't bogging down from load... its flat out not working as hard. Its as if it decided it didn't want to work as hard, so it eases off. Never seen anything like it. Here's the code in a nutshell. Can anyone see something I am doing that is causing this work slowdown? <cfset variables.threadArray=arrayNew(1)> <cfset variables.threadCount=4> <cfquery name="getData" datasource="#variables.dsn#"> [sql goes here] </cfquery> <cfset variables.loopCounter=0> <cfloop condition="variables.loopCounter LT getData.recordCount"> <cfset variables.threadsLive=arrayLen(variables.threadArray)> <cfif variables.threadsLive lt variables.threadCount> <cfset variables.loopCounter=variables.loopCounter+1> <cfset variables.thisThreadID=createUUID()> <cfset temp=arrayAppend(variables.threadArray,variables.thisThreadID)> <cfthread name="#variables.thisThreadID#" action="run"> <!--- cfhttp pulls local CF pages and stores as html, queries determine if child pages need building etc. ---> <cfset temp=arrayDeleteAt(variables.threadArray,arrayFindNoCase(variables.threadArray,variables.thisThreadID))> </cfthread> <!--- may or may not do a cfthread join if I want to retrieve variables from inside of the thread ---> </cfif> </cfloop> -- --m@Robertson-- Janitor, The Robertson Team mysecretbase.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:356333 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm