Re: The black art of postgresql.conf tweaking

From: Jeff <threshar(at)torgo(dot)978(dot)org>
To: Paul Serby <paul(dot)serby(at)clockltd(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: The black art of postgresql.conf tweaking
Date: 2004-08-04 13:02:20
Message-ID: 85562EA8-E616-11D8-A77F-000393D1F76E@torgo.978.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance


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(at)jefftrout(dot)com>
http://www.jefftrout.com/
http://www.stuarthamm.net/

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Michal Taborsky 2004-08-04 13:10:55 Re: The black art of postgresql.conf tweaking
Previous Message Paul Serby 2004-08-04 12:45:55 The black art of postgresql.conf tweaking