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:356329
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to