FD_SETSIZE limitation in Windows hamstringing pgbench.c

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: FD_SETSIZE limitation in Windows hamstringing pgbench.c
Date: 2007-10-22 10:11:47
Message-ID: 87abqb1msc.fsf@oxford.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


This change in pgbench.c:

revision 1.71
date: 2007-08-25 10:21:14 +0100; author: ishii; state: Exp; lines: +7 -2;
The upper limit for -c option of pgbench is now obtained from
(FD_SETSIZE - 10) rather than a hardwired number.

Turns out to be, perhaps, ill-advised on Windows where FD_SETSIZE defaults to
64 but can be adjusted by #defining it before including winsock.h. At least
that's what I'm reading on google, I don't know have a Windows machine to test
with myself. But it's definitely true that on Windows you get an error if you
try to run pgbench with more than 54 clients.

I think this can be solved by simply adding this:

--- pgbench.c 27 Sep 2007 21:39:43 +0100 1.72
+++ pgbench.c 22 Oct 2007 10:55:57 +0100
@@ -24,6 +24,7 @@
#include <ctype.h>

#ifdef WIN32
+#define FD_SETSIZE 1024
#include <win32.h>
#else
#include <sys/time.h>

But as I said, I can't test it conveniently. Plus Postgres currently is
bombing out with more than 45 clients anyways due to the handles issue that
others are looking into (hence finding this limitation).

--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gregory Stark 2007-10-22 10:31:59 Re: Latin vs non-Latin words in text search parsing
Previous Message Oleg Bartunov 2007-10-22 09:47:26 Re: Ready for beta2?