This is a classic example of creating new problems because you are not willing to fix an existing bad decision.

Read mod_perl: Choosing the Right Strategy. Pay close attention to the 4th alternative. That is the standard strategy for serving high-volume websites with mod_perl, and it is the standard solution for very good reason. Setting up and configuring that should completely solve your problem.

If you follow your idea and set up a connection pooling server, what you'll essentially have done is inserted another tier in your web architecture that everything proxies through. That's a lot of overhead for no gain over the standard architecture. Worse yet, if your web pages sometimes don't release their database connections before sending data back, then you've reinvented your current architecture with more complications and overhead. Conversely if they are too eager to grab and release connections in a fine-grained way, then you've added a lot of overhead on your webservers from grabbing and releasing connections in the pool for no gain over the standard architecture.

If you're absolutely not willing to reconsider the existing architectural decisions, then instead of inserting a connection pooling server I would highly recommend inserting a FastCGI server. Then move your logic from Apache to FastCGI. Your code won't change much and you'll wind up with what is essentially the recommended Apache configuration with slightly different technology choices. That will work well for the same reasons that the recommended Apache configuration does.


In reply to Re: Connection pooling for a Net::Server application by tilly
in thread Connection pooling for a Net::Server application by alech

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.