in reply to Timing concerns on PerlEX/Mod_Perl

Try:

  1. syncing the clocks on your server and client.
  2. Then have your script accept a url parameter (say:?reqtime=12:34:56. Add this to your request via LWP.
  3. Have the script relay this back as a part of the content, and have it add a second (local) timestamp as a part of the content.
  4. Have the client-side script add a third timestamp once the request is completed.

That should allow you to identify whether the delays are on the outbound leg, during generation, or the return part of the circuit. It won't tell you what caused it, but if you know when they are occuring, it will narrow the possibilities somewhat.


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.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."

Replies are listed 'Best First'.
Re^2: Timing concerns on PerlEX/Mod_Perl
by Anonymous Monk on Jul 25, 2008 at 22:46 UTC
    Okay here is detailed results:



    Code Time=0.0715248584747314 seconds

    Start Code Execution=1217024869.1958

    End Code Execution=1217024869.2

    LWP Start Time=1217024848.42043

    LWP End Time=1217024871.99951

    LWP Total Time=23.5790810585022

    LWP Start->Code Start=20.77537 seconds

    Code End->LWP End=2.79951 seconds

    Head Time=20.0828440189362 seconds

    Total LWP Time For Google: 1.80555105209351 seconds

    Margin Of Error For LWP<->Code results: around 2 seconds

    so by the look of this...it took 20 seconds just to start up the code...since the code though is in PerlEX/Mod_Perl it shouldn't take this long..so either server is taking logn time to start up...or ModPerl and PerlEX are loosing their cache/taking long time to access the cache?
    Anyone have any ideas on what to do now?
      Anyone have any ideas on what to do now?

      I know naff all about PerlEz or Mod_perl, but I would think the next thing to do is determine if it is all scripts on that server, or just this particular script.

      Ie. Write a simple script that does nothing except produce the timing information as above.

      • If that also displays the same effects, it is a 'server problem'.

        Contact the hoster and ask for a different setup?

      • If not, then you're down to trying to isolate what it is in that script that causes it.

        The usual process of commenting everything but the timing code out and then putting it back a bit at a time until the problem manifects itself again seems appropriate.


      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.
        I isolating is kind of hard since I use one central code that loads functions. So it would pretty much means rewriting the entire code.

        What PerlEX and Mod_Perl do is they pre-load a lot of the variables and start up into memory and then execute threads that access the persistent data.

        personally I do not think im storing that much data into ram that would give it issues in spawning threads but it could be my use of namespaces :/..if there was only a way..maybe ISAPI component to monitor script start up or etc :/...or maybe some apache functions?
      or ModPerl and PerlEX are loosing their cache/taking long time to access the cache?

      Or you're not using ModPerl/PerlEX at all, and its just plain CGI (or the really really slow one is running as CGI)

        I assure you that isn't the case..I wanted to see what would happen if I ran it as regular CGI...it completely froze my server and had to restart. Regular CGI would never be able to achieve 0.07 loading speeds..well maybe a "Hello World"? (not to mention the start up time would not be the issue but execution time would be..as regular perl it took 8 seconds to load..4 seconds for begin block and 4 seconds for regular code execution)

        Anyways point being is I'm 100% sure it is all PerlEX/Mod_Perl.