Not sure what you mean by "small," since you'll need to load in the
Ruby interpreter if you want to run Ruby code. Have a look at the HTTP
server built into the Ruby/EventMachine package.
···
On Nov 15, 2007 9:53 AM, Michael Conrad <list-ruby@friggleware.de> wrote:
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'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.
Anybody knows a *small* webserver, which is able to run some ruby code ?
Not sure what you mean by "small," since you'll need to load in the
Ruby interpreter if you want to run Ruby code. Have a look at the HTTP
server built into the Ruby/EventMachine package.
loading a ruby interpreter is no problem, I'am running other ruby software
on the embedded device without problems (7-8 MB RAM usage). The problem
only occurs in combination with webrick. At startup 8 MB RAM are used,
after the first request, 16 MB RAM are blocked.
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?
Cheers-
-Ezra
···
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.
i just started hacking on this too! i'm leaning towards simply wrapping one nginx to to ruby fastcgi process and going from there - but a ruby module looks very interesting. any code in repo?
On Nov 16, 2007, at 6:23 AM, Michael Neumann wrote:
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.
--
it is not enough to be compassionate. you must act.
h.h. the 14th dalai lama
On Nov 16, 6:23 am, Michael Neumann <mneum...@ntecs.de> 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.
Give Lighttpd a try. It might be a bit more "lightweight" than mongrel.
···
On Nov 15, 2007 6:35 PM, Michael Conrad <list-ruby@friggleware.de> wrote:
loading a ruby interpreter is no problem, I'am running other ruby software
on the embedded device without problems (7-8 MB RAM usage). The problem
only occurs in combination with webrick. At startup 8 MB RAM are used,
after the first request, 16 MB RAM are blocked.
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.
i just started hacking on this too! i'm leaning towards simply wrapping one nginx to to ruby fastcgi process and going from there - but a ruby module looks very interesting. any code in repo?
Not yet. Maybe in a few days.
Well it turned out that 2MB is only the case if I use libruby18-static.
Regards,
Michael
···
On Nov 16, 2007, at 6:23 AM, Michael Neumann wrote:
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
···
On Nov 16, 2007, at 5:23 AM, Michael Neumann wrote:
I have tried mongrel, but it is the same problem,
after starting the server, more then 16 MB RAM are gone.
Greetings
Micha
I didn't know memory was that important, unfortunatelly there's no other server that's stable and have lower memory footprint, you an try hacking your own (i did it once in perl) but it'll be buggy, and will not support some strange browsers.
A simple mongrel handler uses about 6-7MB of ram for me on 32bit systems. What all are you loading to get it to 16MB?
-Ezra
···
On Nov 15, 2007, at 9:18 AM, Marcin Raczkowski wrote:
Michael Conrad wrote:
Hi Marcin,
mongrel. do your googling next time
I have tried mongrel, but it is the same problem,
after starting the server, more then 16 MB RAM are gone.
Greetings
Micha
I didn't know memory was that important, unfortunatelly there's no other server that's stable and have lower memory footprint, you an try hacking your own (i did it once in perl) but it'll be buggy, and will not support some strange browsers.
A simple mongrel handler uses about 6-7MB of ram for me on 32bit systems. What all are you loading to get it to 16MB?
you are (nearly) right, after startup the mongrel uses about 7-8 MB non relocatable
memory (rss option). But at the same time, the data resident segment (drs option, rss included)
shows 18 MB of RAM. In comparison, webrick needs about 5 MB rss and 14 MB drs.
In contrast the plain ruby interpreter needs about 1,5 MB rss and 3 MB drs.
In contrast the plain ruby interpreter needs about 1,5 MB rss and 3 MB drs.
Are you using a staticly linked ruby or shared libraries? ps aux isn't a great
indicator of memory usage because it will overlap shared libraries. "pmap -d <pid>"
will give you a better indicator of memory usage, and I'm guessing you could toy
with your thread stack size in ulimit to reduce actual footprint quite a bit if
necessary.