pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jeff <threshar@torgo.978.org>
To: Paul Serby <paul.serby@clockltd.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: The black art of postgresql.conf  tweaking
Date: Wed, 4 Aug 2004 09:02:20 -0400
Message-ID: <85562EA8-E616-11D8-A77F-000393D1F76E@torgo.978.org> (raw)
In-Reply-To: <4110DA83.7020505@clockltd.com>
References: <4110DA83.7020505@clockltd.com>


On Aug 4, 2004, at 8:45 AM, Paul Serby wrote:
>
> Apache on the Web server can take up to 300 connections and PHP is 
> using  pg_pconnect
>
> Postgres is set with the following.
>
> max_connections = 300
> shared_buffers = 38400
> sort_mem = 12000
>
> But Apache is still maxing out the non-super user connection limit.
>

Did you restart PG after making that change?
(you need to restart, reload won't change max_connections)

Also, you're sort_mem is likely too high (That is the amount of memory 
that can be used PER SORT) and you s hould back down on shared_buffers. 
(General consensus is don't go over 10k shared buffers)

Another thing you may want to try is using pgpool and regular 
pg_connect - this way you only have a pool of say, 32 connections to 
the DB that are shared among all apache instances.  This gets rid of 
the need to have hundreds of idle postgres'  sitting around.  
Connecting to pgpool is very fast. We use it in production here and it 
works wonderfully.  And it is 100% transparent to your application.

--
Jeff Trout <jeff@jefftrout.com>
http://www.jefftrout.com/
http://www.stuarthamm.net/




view thread (14+ messages)  latest in thread

Message-ID: <85562EA8-E616-11D8-A77F-000393D1F76E@torgo.978.org>
Permalink:  ../85562EA8-E616-11D8-A77F-000393D1F76E@torgo.978.org/
Also on:    postgresql.org/message-id/85562EA8-E616-11D8-A77F-000393D1F76E@torgo.978.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: threshar@torgo.978.org, paul.serby@clockltd.com
  Subject: Re: The black art of postgresql.conf  tweaking
  In-Reply-To: <85562EA8-E616-11D8-A77F-000393D1F76E@torgo.978.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox