FD_SETSIZE on Linux?

From: Thom Brown <thom(at)linux(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: FD_SETSIZE on Linux?
Date: 2014-09-09 22:46:59
Message-ID: CAA-aLv4ftLRHSb+vVyuotVMoE1pqxk9LxawoNrfzF0Z=SG46QA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-hackers by date

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