webrick alternative

M

Michael Conrad

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 ?


Greetings

Michael
 
F

Francis Cianfrocca

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 ?


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.
 
M

Michael Conrad

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
 
M

Michael Conrad

Hi,
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.


Greetings

Micha
 
M

Marcin Raczkowski

Michael said:
Hi Marcin,

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.
 
E

Ezra Zygmuntowicz

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
 
B

Brian Adkins

I didn't know memory was that important

Apparently in your rush to be rude, you didn't even bother to read the
OP. Rudeness plus ignorance is a bad combination.

"looking for a small webserver"
"the memory footprint is unacceptable"
"Anybody knows a *small* webserver"
 
M

Michael Neumann

Michael said:
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
 
A

Andrei Maxim

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.

Give Lighttpd a try. It might be a bit more "lightweight" than mongrel.
 
E

Ezra Zygmuntowicz

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?

Cheers-
-Ezra
 
A

ara.t.howard

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?

cheers.

a @ http://codeforpeople.com/
 
S

Sean O'Halpin

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 ?


Greetings

Michael
Not sure how small in machine memory it is, but in terms of cognitive
load, rack is as light as you can get. See
http://yeahnah.org/files/rack-presentation-oct-07.pdf and
http://rack.rubyforge.org/

Regards,
Sean
 
A

aemadrid

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

I'd love to play with it!

AEM
 
M

Michael Neumann

ara.t.howard said:
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
 
M

Michael Neumann

Ezra said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top