From: Qi Lu Date: 2009-05-11T22:23:01+09:00 Subject: Re: Too many open files Roger Pack wrote: >> Windows XP has a limit of 255 files opened by any process, including >> stdin, stdout and stderr. I googled for how to increase the limit, and >> have not found a solution other than: > > A few things since I ran into this problem before: > msvcrt 6 (ruby's default) has a limit of 512. Ruby itself "duplicates" > fd objects when created, so that it can have the "original" and a more > "linuxy" equivalent (I think that's why--it explains it more in the > source I just glanced at it once). So with msvcrt 6 and ruby you're > limited at 512. Thank you very much for your reply. It makes me understand the limit. But why do I have only 256 limit not even 512? I use Ruby 1.8.6 version and run on XP. If I can make my limit to 512, it will help little bit. > > That being said, be *very* aware that select calls are limited to 64 > sockets MAX. So even though you can open 256, don't use more than 64 > ever ever ever. Though I suppose now that we have Ruby 1.9 (have as > in...it compiles [1]) you could use multiple threads, and, per thread > pass in 64. I think that would get around that one limitation--I think > :) > Actually it *might* be possible to through them all into a single select > (single threaded), thanks to Usaku Nakamura's fixing this bug [1]. Since my application is not that time critical, I use a single thead to do the select. and slice all sockets into multiple a group of 64 i/o array. I have got around of 64 limit. my problem is realy 256 max open file limit. What I can do to make it at least 512? Thanks Qi -- Posted via http://www.ruby-forum.com/.