Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-jdbc by date

Next:From: Csaba NagyDate: 2006-11-27 15:38:07
Subject: Re: Postgres Server collapse
Previous:From: Dave CramerDate: 2006-11-27 15:33:06
Subject: Re: Postgres Server collapse

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group