Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 5F97D9FC32C for ; Wed, 24 Oct 2007 10:17:33 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 85395-02 for ; Wed, 24 Oct 2007 10:17:26 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from oxford.xeocode.com (unknown [87.127.95.196]) by postgresql.org (Postfix) with ESMTP id E09259FC2FD for ; Wed, 24 Oct 2007 10:17:25 -0300 (ADT) Received: from localhost.enta.net ([127.0.0.1] helo=oxford.xeocode.com) by oxford.xeocode.com with esmtp (Exim 4.67) (envelope-from ) id 1Ikg6s-0002V0-IN; Wed, 24 Oct 2007 14:17:22 +0100 To: "Honza Novak" Cc: Subject: Re: multiple apaches against single postgres database In-Reply-To: <471F3752.8070205@developers.zlutazimnice.cz> (Honza Novak's message of "Wed\, 24 Oct 2007 14\:15\:14 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) X-Draft-From: ("nnimap+mail01.enterprisedb.com:INBOX.performance" 2931) References: <471F3752.8070205@developers.zlutazimnice.cz> From: Gregory Stark Organization: EnterpriseDB Date: Wed, 24 Oct 2007 14:17:22 +0100 Message-ID: <87r6jkslct.fsf@oxford.xeocode.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200710/272 X-Sequence-Number: 27294 "Honza Novak" writes: > Hi all, > i'm looking for correct or at least good enough solution for use of multiple > apaches with single postgres database. (apaches are 2.0.x, and postgres is > 8.1.x) > > At this moment i'm involved in management of a website where we have large user > load on our web servers. Apaches are set up to be able to answer 300 requests > at the same time and at the moment we have 4 apaches. Do you have 300 processors? Are your requests particularly i/o-bound? Why would running 300 processes simultaneously be faster than running a smaller number sequentially? It doesn't sound like your systems are capable of handling such a large number of requests simultaneously. The traditional answer is to separate static content such as images which are more i/o-bound onto a separate apache configuration which has a larger number of connections, limit the number of connections for the cpu-bound dynamic content server, and have a 1-1 ratio between apache dynamic content connections and postgres backends. The alternative is to use connection pooling. Often a combination of the two is best. -- Gregory Stark EnterpriseDB http://www.enterprisedb.com