Re: More than 1024 connections from the same c-backend

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andreas Muck <bb+list(dot)pgsql-general(at)blitztrade(dot)de>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: More than 1024 connections from the same c-backend
Date: 2003-09-04 13:54:21
Message-ID: 21759.1062683661@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Andreas Muck <bb+list(dot)pgsql-general(at)blitztrade(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Edwin Quijada 2003-09-04 14:02:25 Activate Index
Previous Message Greg Stark 2003-09-04 13:52:50 Re: Replaceing records