Re: Postgresql with max_connections=4096

From: denis(at)edistar(dot)com
To: Richard Huxton <dev(at)archonet(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Postgresql with max_connections=4096
Date: 2005-07-27 08:22:48
Message-ID: 42E74458.70704@edistar.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Richard Huxton wrote:

> denis(at)edistar(dot)com wrote:
>
>> We have a postgresql server configured with max_connections=4096.
>> We have such a high number of max_connections because there are 8 web
>> servers connected to the database and all use persistent connections.
>> Each web server can have 256 max clients and 2 connection strings, so
>> the max connections to the db is 256 * 8 * 2=4096.
>
>
> The one-word answer is "pgpool" http://pgpool.projects.postgresql.org/
> You don't really want them all using persistent connections directly
> to the DB.
>
Already checked.
We set a machine with only pg_pool installed as a fronted to the real db.
If I disable persistent connections and I use pg_pool with 4096
preforked clients, the load of the pg_pool server goes very high and the
takes down also the real database server. Maybe should I try installing
pg_pool direcly into the database server to avoid network traffic?

>> To start the postgresql, I must to do some kernel extra configuration:
>>
>> kernel.shmmax = 1165063808
>> kernel.sem=512 64000 100 512
>>
>> and the parameters i changed other than max_connections in the
>> postgresql.conf are:
>>
>> - shared_buffers = 131072
>
>
> That's a *very* big shared_buffers value. Try reducing it by a factor
> of 10 and reading the "performance tuning" article here:
> http://www.varlena.com/varlena/GeneralBits/Tidbits/index.php

Already read. I put 25% of total memory as that specified by Bruce
Momjian performance howto but now i'm lowering 65536

>
> Sounds like a BEGIN being re-issued alright. Solution - fix your
> application(s) and don't use persistent connections (or if you do,
> make sure you rollback any pre-existing transactions and issue any
> relevant SET commands).
>
If that was the problem, I should obtain always that error but I obtain
that error only after two/three hours of testing.

Thank you for your help,
Denis

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tino Wildenhain 2005-07-27 08:49:34 Re: GUID for postgreSQL
Previous Message Janning Vygen 2005-07-27 08:01:23 Re: Trigger disactivation and SELECT WAITING