Re: More than 1024 connections from the same c-backend - Mailing list pgsql-general

From Tom Lane
Subject Re: More than 1024 connections from the same c-backend
Date
Msg-id 21759.1062683661@sss.pgh.pa.us
Whole thread Raw
In response to More than 1024 connections from the same c-backend  (Andreas Muck <bb+list.pgsql-general@blitztrade.de>)
Responses Re: More than 1024 connections from the same c-backend
List pgsql-general
Andreas Muck <bb+list.pgsql-general@blitztrade.de> writes:
> We have an application running on Linux (SuSE 7.2, kernel 2.4.16) that
> opens lots of connections to a Postgres database and occasionaly dies
> with segfault.

> The program seems to crash when it returns from pqWaitTimed(). As
> pqWaitTimed uses select() to poll the file descriptors, I suppose the
> crash is related to the limit of 1024 file descriptors that fd_set can hold.

If that's the size of fd_set on your machine, then yes, this doesn't
surprise me at all.  The code that calls select() is no doubt clobbering
some bit beyond the end of the fd_set array.

7.4 is designed to use poll() in preference to select() (if available),
because of previous complaints about exactly this problem.  Not sure if
you want to update to 7.4 beta, but you could consider lifting the
pqWait code out of 7.4.

            regards, tom lane

pgsql-general by date:

Previous
From: Greg Stark
Date:
Subject: Re: Replaceing records
Next
From: "Edwin Quijada"
Date:
Subject: Activate Index