From: Robert Klemme Date: 2009-05-08T00:44:15+09:00 Subject: Re: Too many open files 2009/5/7 Qi Lu : > I am writing an application server using TCP server which can only > accept upto 249 client connections. After that, I get 'Error: Too many > open files..'. I run my server in Windows XP. > > 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: > > 1. modify main.c and call _setmaxstdio(n), which need recompile ruby; > 2. use Win32 API to accept connection. > > I noticed that there are so many people post this problem but their > limits are different, some people have 512, some have 1024. looks like > this number is configurable. my machine is set to 255 which is way too > low. I can run multiple processes to get around this problem, but not 23 > process to support 5000 connections. > > Anything I can do to fix this? Thanks in ahead. AFAIK you need to get yourself a copy of a *Server* version of Windows because the limit is built into the OS version (or license). Microsoft's reasoning is that if you plan to put up a server which can sustain higher loads then you are probably doing this for commercial reasons and hence should pay for it. Apart from that you will also get more tools do administer the server. If you do not have a fixed platform requirement, then getting a Linux box is probably the cheaper choice. Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/