http://www.perlmonks.org?node_id=924097


in reply to Diagnosing a pregnant pause.

Okay ... it's waiting on a mutex of some kind, and it has a three-second timeout. That much we know. But, what happens "consistently, 18 seconds into the run," in your application logic? What does it do ask-for differently at that one point in time, and only at that one point in time?

Replies are listed 'Best First'.
Re^2: Diagnosing a pregnant pause.
by BrowserUk (Patriarch) on Sep 04, 2011 at 15:03 UTC

    If you'd looked at the code, you'd see that it spends its entire time in a loop doing the same things -- reading from an input file and writing to many output files -- over and over.

    The pause appears to occur when the cumulative affect of many writes to many output files exhausts the file cache buffers and it needs to flush them to disk en-masse before it can continue.

    The intriguing thing was why this pregnant pause would only occur once, rather early in the run. The answer to that appears to be that the OS defers allocating disk extants to output files until it needs to flush the first write from the cache.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.