From: Mark Lewis <mark.lewis@mir3.com>
To: Sistemasvi <sistemasvi@aerogal.com.ec>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Postgres Server collapse
Date: Mon, 27 Nov 2006 07:34:37 -0800
Message-ID: <1164641677.9690.269.camel@archimedes> (raw)
In-Reply-To: <002401c71237$92e23cf0$9f0a0a0a@aerogald.com>
References: <002401c71237$92e23cf0$9f0a0a0a@aerogald.com>
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
>
>
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: mark.lewis@mir3.com, sistemasvi@aerogal.com.ec
Subject: Re: Postgres Server collapse
In-Reply-To: <1164641677.9690.269.camel@archimedes>
References: <002401c71237$92e23cf0$9f0a0a0a@aerogald.com> <1164641677.9690.269.camel@archimedes>
* 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