Re: 8.2.3: Server crashes on Windows using Eclipse/Junit

From: "Trevor Talbot" <quension(at)gmail(dot)com>
To: "Laurent Duperval" <lduperval(at)yahoo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: 8.2.3: Server crashes on Windows using Eclipse/Junit
Date: 2007-11-30 05:51:02
Message-ID: 90bce5730711292151l4b9bad09ta3e588f575e800b6@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On 11/29/07, Laurent Duperval <lduperval(at)yahoo(dot)com> wrote:

> To summarize: when I run unit tests with eclipse (and with Ant) on
> Windows, at some point, I run out of available connections. I tried
> increasing the maximum number of connections, but then I started seeing
> the postgres server die and restart.

The conclusion was that under Windows XP, postgres is normally limited
to a maximum of 125-150 connections. Raising max_connections higher
than that will lead to the crashes you saw.

> > Rainer Bauer wrote:
> >> After increasing the session heap size in the registry from 512KB to 1024KB
> >> the no. of connections was roughly doubled. So this might be a solution for
> >> people running out of Desktop heap.
> >>
> >> Alter the value of the following key
> >> <HKLM\System\CurrentControlSet\Control\Session Manager\SubSystems\Windows>
> >>
> >> The numeric values following "SharedSection=" control the heap management:
> >> On WinXP these are the default values: "SharedSection=1024,3072,512"
> >> Altering this to "SharedSection=1024,3072,1024" will increase the heap for all
> >> non-interactive window stations to 1024KB.

> Does this allow creating more connections? At some point, the discussion
> became too technical for me, and I no longer could tell if the answer was
> for developers of for users.

Yes. After making that change and restarting Windows, postgres will be
able to safely handle 250-300 connections.

> I saw other messages dealing with semaphores/connection relations, etc.
> But unless I really did not understand the discussion, none of them seemed
> to address the issue I was seeing.

Right, we were just trying to find the precise resource limit that was
causing the crash.

> I'm thinking that the Java driver combined with Hibernate may be keeping
> handles open for too long, because my tests aren't supposed to maintain
> connections open for very long. I also would expect the connections to
> either be closed or released once the statements are executed.

This is where I would start on your problem. Increasing the max
connections is one thing, but having so very many simultaneous
operations in progress on your database is probably not productive, as
it's likely to spend more time juggling tasks than actually performing
them.

I'm not familiar with Java tools, so someone else will have to chime
in with specific suggestions. It may be something as simple as
limiting how many tests JUnit/Ant tries to run at the same time, or
some parameter buried in Hibernate or the driver.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Greg Smith 2007-11-30 06:18:11 Re: Linux v.s. Mac OS-X Performance
Previous Message Gregory Williamson 2007-11-30 05:47:44 Re: Simple math statement - problem

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2007-11-30 05:56:10 Re: CommandCounterIncrement versus plan caching
Previous Message Bruce Momjian 2007-11-30 01:09:15 Re: Status report on 8.3 releaset