I run these test with simple test.cgi and apache server respond fast.

Good - so the problem is just with your script. Now, when you run the script from the shell and from the web server there are 3 main differences:

You can test out the first of these by running the script from the shell as the user and group who execute the Apache processes (eg. with sudo). For the environment your best plan is to dump it from within the script and compare these dumps from running in both ways - shell and web. Any differences there may well be relevant. Also dump %INC at the end while you are at it as you may find that there are different versions of modules being loaded which can otherwise be tricky to spot. Finally, to see if the context is affecting operations, check the audit log.

You might also be interested to read through the Basic debugging checklist if you are not already familiar with it as there are some good practices and hints which may help.


In reply to Re^3: Apache2 to perl slow start by hippo
in thread Apache2 to perl slow start by Acnapyx

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.