From: Michael Neumann Date: 2007-11-20T18:38:23+09:00 Subject: Re: webrick alternative Ezra Zygmuntowicz schrieb: > > On Nov 16, 2007, at 5:23 AM, Michael Neumann wrote: > >> Michael Conrad schrieb: >>> Hi, >>> I'am looking for a small webserver running some ruby classes/servlets. >>> My first steps I was going with webrick, but the memory footprint >>> is unacceptable for the target plattform. >>> Anybody knows a *small* webserver, which is able to run some ruby code ? >> >> I'm currently embedding Ruby into nginx (www.nginx.net). It's not yet >> done as I started yesterday and as I'm doing it for fun.... A minimal >> worker process has ~2MB at the moment. I think it's impossible to >> reduce this any more. >> >> My initial benchmarks (which doesn't say anything) showed it to be at >> least 2-times as fast as mongrel. >> >> Regards, >> >> Michael >> > > > Michael- > > I'd love to play with ruby embedded in nginx. Care to have any > testers? How are you dealing with the event driven nature of nginx when > embedding the ruby interpreter? Do ruby requests block the entire worker > process while they run? In the initial version a Ruby request handler would block the entire work process, i.e. performances depends on how long the request handler takes, which clearly is not optimal. Despite of that, it was in all cases faster than mongrel, simply because all requests had to wait (in reality there are fast requests and slow requests). But that's clearly a non-optimal (at least theoretical) solution :) What I am doing now is to embed a Ruby pthread into nginx and use nginx upstream handlers to post requests to this pthread and receive responses. I'm still having a few problems here, especially with Ruby 1.9, which I'd like to use due to it's native threads (so that Ruby request handlers do not block each other). I can't await to see how it performs compared to mongrel. Once I have a mostly working version of this out, I'll announce it on ruby-talk. Regards, Michael