The load refers to how many processes are ready to run on average when the scheduler has to pick someone. If the system is on its knees and load is low, then you have a bottleneck elsewhere. It seems likely that your system is heavily in swap, but it is also possible that you are doing something else silly like disconnecting from the database with every request. (That particular silliness should not bring you below the performance of mod_cgi, and you show other signs of memory problems.)

I would still go with my previous recommend as an obvious first step. After you do that you should be able to drop the number of mod_perl Apache kids substantially and maintain throughput. It would also be good longer term to audit the code looking for where memory is likely to be allocated and not freed at the end of each request. Devel::Leak may help you do that.

I'm not entirely sure of what you mean by "automatically restart of apache every 10 minutes". If you mean that Apache has to stop and launch again, that suggests that your machine is getting out of memory and random processes are being killed. This is very bad. If you mean that Apache children are dying that frequently, that is fairly harmless. Think of it this way, if your average Apache child lasts 10 minutes and you have 20 of them, then you have one child being launched every 30 seconds. Compare with 45 being launched per second and you see improvement. The time to be able to launch processes is not going to be an issue until they die a lot faster than that!

Incidentally once you are on mod_perl, writing real mod_perl handlers rather than using Apache::Registry should both considerably boost performance and save memory. (I don't know that you're using that, but it is a pretty safe guess.)


In reply to Re^3: CgiProxy And Heavy Visitors by tilly
in thread CgiProxy And Heavy Visitors by artin

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.