Re: Postgres Server collapse

From: Mark Lewis <mark(dot)lewis(at)mir3(dot)com>
To: Sistemasvi <sistemasvi(at)aerogal(dot)com(dot)ec>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Postgres Server collapse
Date: 2006-11-27 15:34:37
Message-ID: 1164641677.9690.269.camel@archimedes
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Keeping one connection per session is a no-no if you need your site to
scale. You'll want to use some kind of database connection pooling
instead. Remember that sessions only expire after a certain amount of
inactivity. Depending on your servlet container, the timeouts will be
between 20 and 60 minutes by default. This means that if your DB server
can only handle, say, 250 connections, then you can't handle more than
250/60 = 4.17 new sessions per minute. And you do have code to clean up
if the session times out, right?

-- Mark Lewis

On Mon, 2006-11-27 at 10:19 -0500, Sistemasvi wrote:
> Hello.
>
> I have a postsgresql database with max 500 connections. All
> development is in Java (View, Model, controller model). The problem is
> when I have high traffic (about 10 AM) when the database server
> collapse. The server turn too slow as It haven´t memory and the swap
> memory increase too much. I must kill all postgres connections and
> restart postmaster service.
>
> I have only one connection by web session. It is good or bad?
> I have already increased the number of connections to 800 in the
> postgres and sysctl configuration file.
>
> My server is linux Red Hat and Postgres database V8
>
> Which can be the problem?.
>
>
> Carlos
>
>

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Csaba Nagy 2006-11-27 15:38:07 Re: Postgres Server collapse
Previous Message Dave Cramer 2006-11-27 15:33:06 Re: Postgres Server collapse