FD_SETSIZE on Linux? - Mailing list pgsql-hackers

From Thom Brown
Subject FD_SETSIZE on Linux?
Date
Msg-id CAA-aLv4ftLRHSb+vVyuotVMoE1pqxk9LxawoNrfzF0Z=SG46QA@mail.gmail.com
Whole thread Raw
Responses Re: FD_SETSIZE on Linux?
List pgsql-hackers
Hi,

I noticed when trying to set pgbench's client count to a high number, I had to reduce it, and I found the maximum I can get away with is 1014.  Any higher and I get:

invalid number of clients: 1015

I find this in pgbench.c:

#ifdef FD_SETSIZE
#define MAXCLIENTS      (FD_SETSIZE - 10)
#else
#define MAXCLIENTS      1024
#endif


And FS_SETSIZE defined before it:

#ifdef WIN32
#define FD_SETSIZE 1024                 /* set before winsock2.h is included */
#endif   /* ! WIN32 */

... but apparently only if using Windows, which I'm not.

So it appears that MAXCLIENTS is being set to 1014 (1024 - 10), which looks like should only be the case on Windows.

I'm a bit confused here.  Shouldn't my MAXCLIENTS be set to 1024?

Thom

pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: [Fwd: Re: proposal: new long psql parameter --on-error-stop]
Next
From: Tomas Vondra
Date:
Subject: Re: bad estimation together with large work_mem generates terrible slow hash joins