pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Rowley <dgrowleyml@gmail.com>
Cc: Jawarilal, Manish <Manish.Jawarilal@dell.com>
Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Subject: Re: pgbench bug / limitation
Date: Mon, 01 Jun 2020 20:21:27 -0400
Message-ID: <512846.1591057287@sss.pgh.pa.us> (raw)
In-Reply-To: <CAApHDvrjWtJa9oQ98oH+9PCvTgOkGZP+gcmottNX95sjn6o9fQ@mail.gmail.com>
References: <BL0PR1901MB1985F219C46C61EDE7036C34ED8E0@BL0PR1901MB1985.namprd19.prod.outlook.com>
	<7221.1590687090@sss.pgh.pa.us>
	<BL0PR1901MB1985A8B4D3E5B39E32A9EA55ED8F0@BL0PR1901MB1985.namprd19.prod.outlook.com>
	<10327.1590763515@sss.pgh.pa.us>
	<BL0PR1901MB198583EAC6C8A3B770D20F1AED8A0@BL0PR1901MB1985.namprd19.prod.outlook.com>
	<384920.1591027137@sss.pgh.pa.us>
	<CAApHDvrjWtJa9oQ98oH+9PCvTgOkGZP+gcmottNX95sjn6o9fQ@mail.gmail.com>

David Rowley <dgrowleyml@gmail.com> writes:
> I added the following line to the top of add_socket_to_set():
> printf("add_socket_to_set fd = %d\n", fd);

> However, on Windows, I get:
> add_socket_to_set fd = 392
> add_socket_to_set fd = 388
> add_socket_to_set fd = 408
> add_socket_to_set fd = 404
> add_socket_to_set fd = 412
> add_socket_to_set fd = 420

Interesting.

> Shouldn't: if (fd < 0 || fd >= FD_SETSIZE) just become: if (idx > FD_SETSIZE) ?

Certainly not, because it's the fd not the idx that is being added
into the fd_set.  I am not too sure about the underlying implementation
on Windows, but on Unix-like OSes, FD_SETSIZE *is* the size of that bit
array.  What you suggest would allow memory stomps.

Given your results, I'm guessing that we are indeed managing to increase
the fd_set size to 1024, but that's not enough to allow order-of-1000
connections because there are other things competing for FD identifiers.
Maybe we should just crank up the forced value of FD_SETSIZE (to, say,
8192)?

			regards, tom lane





view thread (26+ messages)  latest in thread

Message-ID: <512846.1591057287@sss.pgh.pa.us>
Permalink:  ../512846.1591057287@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/512846.1591057287@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, dgrowleyml@gmail.com, Manish.Jawarilal@dell.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: pgbench bug / limitation
  In-Reply-To: <512846.1591057287@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox