From: matz@... (Yukihiro Matsumoto) Date: 2002-07-11T09:37:44+09:00 Subject: Re: Bug in socket code - high number of simul. conns causes segfault Hi, In message "Re: Bug in socket code - high number of simul. conns causes segfault" on 02/07/11, Paul Brannan writes: |Since Ruby uses user-level threads and calls select() for you with all |of the file descriptors that all of the threads are waiting on, there's |not really any way you can get more than FD_SETSIZE file descriptors |with Ruby the way it is, no matter how many threads you use. It's still |odd that the segfault occurs after 500 connections; it should happen |after 1000. It's almost as if Ruby is using 2 file descriptors per |connection, though I'm not sure why it would do that. Socket comsumes two file descriptors per connection, to achieve bi-directionl "stdio" connection. |One solution, if you really need this many file descriptors, is to |increase FD_SETSIZE. An alternative might be to modify the interpreter |to use poll() or /dev/poll instead of select(), on systems where they |are available. Both of these are capable of handling more than 1000 |file descriptors. Interesting idea. matz.