From: Jeremy Evans Date: 2008-01-15T01:11:26+09:00 Subject: Re: Thin v0.5.2 Cheezburger released Thomas Hurst wrote: > * Marc-Andr? Cournoyer (macournoyer@gmail.com) wrote: > >> * Add cluster support through the -s option in the thin script, start 3 >> thins like this: >> thin start -s3 -p3000 >> 3 thin servers will be started on port 3000, 3001, 3002, also the port >> number will be injected in the pid and log filenames. > > Is it infeasable to support preforking after the listen socket's been > opened, so many processes serve off the same port? I've done this for a > while now with FastCGI and other Ruby servers. > > When I questioned Zed about it re mongrel a few years ago he mentioned > something about IO streams getting confused, which I've never seen; > perhaps OS-specific, on systems where concurrent accept() on a socket > isn't supported? > > Be nice to have a multiprocess server that didn't require a fancy load > balancer, at least on "safe" platforms, if possible. ruby-style [1] supports what you want, serving Rails via Mongrel or SCGI. It starts a supervising process that opens port(s) and then forks children to listen on those port(s). You can have multiple children listening on the same port. It's primarily designed to supporting restarting the application without losing requests (since the listening socket is never closed), but it works for load balancing as well. I've tried making it work with evented Mongrel, and I couldn't get it to work, probably for reasons Francis mentioned. [1] https://rubyforge.org/projects/ruby-style/ Jeremy -- Posted via http://www.ruby-forum.com/.