Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id E76242E0067 for ; Thu, 10 Apr 2008 18:29:08 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 80757-03 for ; Thu, 10 Apr 2008 18:29:05 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by developer.postgresql.org (Postfix) with ESMTP id DD4152E006D for ; Thu, 10 Apr 2008 18:29:05 -0300 (ADT) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Jk4KL-0004iK-3e for pgsql-performance@postgresql.org; Thu, 10 Apr 2008 21:29:01 +0000 Received: from frigga.summersault.com ([12.161.105.138]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 10 Apr 2008 21:29:01 +0000 Received: from mark by frigga.summersault.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 10 Apr 2008 21:29:01 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-performance@postgresql.org From: Mark Stosberg Subject: Re: recommendations for web/db connection pooling or DBD::Gofer reviews Date: Thu, 10 Apr 2008 17:28:51 -0400 Lines: 34 Message-ID: <47FE8693.4070700@summersault.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: frigga.summersault.com User-Agent: Thunderbird 2.0.0.12 (X11/20080227) In-Reply-To: X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200804/137 X-Sequence-Number: 29630 > Under heavy load, Apache has the usual failure mode of spawning so > many threads/processes and database connections that it just exhausts > all the memory on the webserver and also kills the database. > As usual, I would use lighttpd as a frontend (also serving static > files) to handle the large number of concurrent connections to clients, > and then have it funnel this to a reasonable number of perl backends, > something like 10-30. I don't know if fastcgi works with perl, but with > PHP it certainly works very well. If you can't use fastcgi, use lighttpd > as a HTTP proxy and apache with mod_perl behind. > Recipe for good handling of heavy load is using an asynchronous > server (which by design can handle any number of concurrent connections > up to the OS' limit) in front of a small number of dynamic webpage > generating threads/processes. Thanks for the response. To be clear, it sounds like you are advocating solving the problem with scaling the number of connections with a different approach, by limiting the number of web server processes. So, the front-end proxy would have a number of max connections, say 200, and it would connect to another httpd/mod_perl server behind with a lower number of connections, say 20. If the backend httpd server was busy, the proxy connection to it would just wait in a queue until it was available. Is that the kind of design you had in mind? That seems like a reasonable option as well. We already have some lightweight Apache servers in use on the project which currently just serve static content. Mark