Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 536C49FB209 for ; Mon, 27 Nov 2006 11:35:09 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-new, port 10024) with ESMTP id 06313-05 for ; Mon, 27 Nov 2006 11:34:52 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from mir3-fs.mir3.com (mail.mir3.com [65.208.188.100]) by postgresql.org (Postfix) with ESMTP id 527A79FB1CE for ; Mon, 27 Nov 2006 11:34:58 -0400 (AST) Received: mir3-fs.mir3.com 172.16.1.11 from 172.16.2.68 172.16.2.68 via HTTP with MS-WebStorage 6.0.6249 Received: from archimedes.mirlogic.com by mir3-fs.mir3.com; 27 Nov 2006 07:34:38 -0800 Subject: Re: Postgres Server collapse From: Mark Lewis To: Sistemasvi Cc: pgsql-jdbc@postgresql.org In-Reply-To: <002401c71237$92e23cf0$9f0a0a0a@aerogald.com> References: <002401c71237$92e23cf0$9f0a0a0a@aerogald.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Organization: MIR3, Inc. Date: Mon, 27 Nov 2006 07:34:37 -0800 Message-Id: <1164641677.9690.269.camel@archimedes> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 (2.0.2-27.rhel4.6) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200611/142 X-Sequence-Number: 16184 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 =3D 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. > =20 > 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=C2=B4t memory and the swap > memory increase too much. I must kill all postgres connections and > restart postmaster service. > =20 > 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. > =20 > My server is linux Red Hat and Postgres database V8 > =20 > Which can be the problem?. > =20 > =20 > Carlos > =20 > =20