This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Low FD_SETSIZE limit on Win32 (PR#41)
Type: enhancement Stage:
Components: Windows Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: tim.peters Nosy List: gvanrossum, mhammond, nobody, tim.peters
Priority: low Keywords:

Created on 2000-08-01 21:15 by anonymous, last changed 2022-04-10 16:02 by admin. This issue is now closed.

Messages (9)
msg799 - (view) Author: Nobody/Anonymous (nobody) Date: 2000-08-01 21:15
Jitterbug-Id: 41
Submitted-By: brian@digicool.com
Date: Fri, 30 Jul 1999 10:10:49 -0400 (EDT)
Version: 1.5.2
OS: NT


It appears that win32 has a default limit of 64 descriptors that 
can be handed to the select() function. This is pretty low for
any serious async servers, and causes them to raise lots of errors
under very moderate loads.

We at DC ran into this using Medusa as a basis for ZServer, which
serves Zope sites. It turns out that you can actually add a define
when compiling the python15.dll for windows to bump the default
fd limit to a more reasonable level.

The approach _I_ took was to add the define: FD_SETSIZE=1024
to the preprocessor options in the MSVC project settings for
python15.dll, though I imagine you could also roll the define
into config.h or something (so long as it's defined before
windows.h or any of the select / socket include files are
referenced). It would make life much easier for win32 server
developers if this define could find its way into the next
official python release :^)

Thanks!


Brian Lloyd        brian@digicool.com
Software Engineer  540.371.6909              
Digital Creations  http://www.digicool.com 




====================================================================
Audit trail:
Fri Jul 30 10:43:41 1999	guido	moved from incoming to request
msg800 - (view) Author: Mark Hammond (mhammond) * (Python committer) Date: 2000-08-31 06:19
I am a little worried that adding it to config.h may have side-effects when Python is embedded in other projects with their own socket config (eg, Mozilla :-)

Now that socket and select are external .pyd modules, will it be sufficient to only add it to these extension modules?
msg801 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2000-09-22 04:16
Changed summary to say "Win32" instead of "NT", as this is a general Win32 issue.

Mark, did you email your question directly to Brian?  (This bug got moved over from Jitterbug, so he didn't see your note otherwise.)

I certainly agree Python can't go changing the MS default value in any way visible from Python.h (which #includes config.h).
msg802 - (view) Author: Mark Hammond (mhammond) * (Python committer) Date: 2000-10-06 04:11
Brian has agreed to help with a specific patch that will remain local to the Python build.  Dropping priority to reflect that it wont affect most users, and wont make 2.0.
msg803 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2000-11-10 20:51
Mark, Guido is agreeable to Python adding its own

#ifndef FD_SETSIZE
#define FD_SETSIZE ???
#endif

block.  If other people are doing the define-this-thing-on-the-cmdline trick, fine, such a block won't interfere with their beliefs.

So the primary remaining question is what "???" should be.  Is 1024 enough?  Someone else just bumped into the 64 limit (Python-Help), but didn't commit to a specific amount.
msg804 - (view) Author: Nobody/Anonymous (nobody) Date: 2000-11-10 23:27
I recently raised this in the help desk for python. 
I am running into this in the WInsock arena and I really want to get over this hump. Can I get a Python dll with 1024 sockets in 1.5.2? I would be happy to test this in the Win2k arena for you (like that is a major gold star).

Really even 256 would be ok for me .. but 1024 is a spot more attractive (as I wouldn't have to keep watch on this all the time). Many thanks to Martin von Loewis and Tim Peters for thier help.

msg805 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2000-11-27 21:22
Tim -- it's time to commit on this. I recommend 512 as a compromise. <0.5 wink>
msg806 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2000-11-27 23:43
Reassigned from MarkH to me.  Unclear what the new value should be (nothing is free ...).
msg807 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2000-12-12 01:19
Boosted the Windows default to 512, in selectmodule.c rev 2.49.
History
Date User Action Args
2022-04-10 16:02:14adminsetgithub: 32844
2000-08-01 21:15:46anonymouscreate