[Mono-bugs] [Bug 71203][Wis] New - Many Socket Methods Fail when > 1024 File descriptors are Open
Wed, 12 Jan 2005 11:21:33 -0500 (EST)
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by firstname.lastname@example.org.
--- shadow/71203 2005-01-12 11:21:33.000000000 -0500
+++ shadow/71203.tmp.11731 2005-01-12 11:21:33.000000000 -0500
@@ -0,0 +1,49 @@
+Product: Mono: Class Libraries
+OS: Red Hat 9.0
+Summary: Many Socket Methods Fail when > 1024 File descriptors are Open
+Please fill in this template when reporting a bug, unless you know what you are doing.
+Description of Problem:
+When many sockets and files are open it's easy to exceed the 1024 limit imposed by the select()
+system call, this system call is used by a number of methods in the socket class and also many
+other parts of System.Net & System.Net.Sockets
+Steps to reproduce the problem:
+1. Open many sockets and filed
+2. Poll the sockets for activity, the polls will begin to fail when their underlying file descriptor is
+Things go wrong in various interesting ways.
+The .Net documentation does not mention any limits for open file descriptors and related socket
+How often does this happen?
+Whenever anyone writes a server which handles thousands of clients.
+Mono under the hood uses select() in a few places, this will ultimately fail if it's asked to select on
+a file descriptor with an ID > 1024, most modern unix systems provide the poll() system call
+which provides similar functionality without the limit. Mono should detect at build time whether
+poll() will be available on the target platform and use it instead of select().
+This limit makes it surprisingly hard to write servers which handle thousands of connections (and
+if you ask any .Net guru they'll chastise you for not using the Async methods - on every mono
+install I've tried they lock up with > 25 pending operations)