rubys web performance

P

Patrick May

Florian Weber said:
there are barely any hosters who support fastcgi, webrick or mod_ruby.
especially since the last one is not usable for shared hosting. so you
have to rely on cgi..

Try Kattare.com, they've told me they do mod_ruby hosting.

Cheers,

Patrick
 
L

Lothar Scholz

Try Kattare.com, they've told me they do mod_ruby hosting.

Just that they do so does not mean that shared mod_ruby hosting is now
working. in a shared hosting environment.

They simply leave there customers alone with the problems, only to add
a new item on there marketing feature list.
 
D

David Garamond

Thomas said:
And while we're talking about lines.. I had to fix the code in
SquirrelMail that encodes the headers when there's non-ASCII
characters in it. Thought that it would be easy as I'd done my own in
Ruby for another project and it was just 7 lines of code. Imagine my
surprise when I found out that it was 118 lines of PHP code. About 10
was 'extra' code for stuff related to SquirrelMail.

I couldn't resist, first I tried rewriting the function to exec
Ruby. Slow as hell, but only 19 lines. Then I ported my Ruby function
as well as I could and it ended up at 32 lines. So even if we subtract
the 10 lines, it's still the difference between 7 and 22 lines.

I know the feeling :) Sometimes I curse while coding in PHP. Though it
does the job, PHP is really an ugly, half-baked, non-designed language.
Even Perl looks beautiful when I'm stuck with PHP. Plus they break
things (and change defaults!) between releases. IMO PHP is really an
undependable tool for large projects.
 
K

Kirk Haines

On Mon, 21 Jun 2004 06:03:15 +0900, Andreas Schwarz wrote
I don't know rails, but all the ruby web frameworks I looked at were
extremely memory and CPU intensive. If you use the relational DB
like it is supposed to, without a generic OO mapping layer, and a simple
templating system like Kwartz, you will see that performance is similar
to PHP.

The disadvantage to running something as a CGI is that there is a parsing
step every time, and a lot of the Ruby libraries are written in Ruby, not C,
so that is a lot of Ruby lines to parse.

The advantage to something like Kwartz is that it is written in C, so it
fundamentally pretty fast.

However, if you run some framework that gives you persistence of code, you
eliminate the code parsing step, and even with heavy apps that are doing a
lot of database interaction and producing a lot of HTML, performance can be
pretty good under Ruby.

David is successfully running Basecamp under Rails, so his performance
benchmarks can't be too bad, and I am running a variety of sites and
applications under Iowa with very reasonable performance. Server hardware
and Ruby version are relevant when talking about speed. On an 800 Mhz PIII
devel box under Linux with Ruby 1.8.1 I range from a high of about .3
seconds/request for a heavy page with about 30k of HTML with data queried
from a database and formatted, cookies checked, and some other data
manipulations down to lows in the thousandths of a second for pages with
less than about 4k of HTML, with some minor dynamic content but no database
queries. Note that these are the times for the Ruby code itself to run and
don't include the overhead for the webserver.

Because of the amount of time that threads spend waiting on other resources,
even with the heavy .3 seconds/request pages, though, I can handle 15-20 of
those per second on this hardware while more typical pages end up
benchmarking around 30-35 per second and the really lightweight ones around
70/second. For comparison, the requests that deliver 30-35/second via FCGI
or mod_ruby, if I instead use CGI, drop to around 6-7/second. These per
second number are all for the complete transaction with the webserver and
the applications, not just the Ruby portion.

These performance numbers, for me, are well within the acceptable range, and
memory usage does not seem to be a problem, either.


Kirk Haines
 
A

Andreas Schwarz

Kirk said:
On Mon, 21 Jun 2004 06:03:15 +0900, Andreas Schwarz wrote


The disadvantage to running something as a CGI is that there is a parsing
step every time, and a lot of the Ruby libraries are written in Ruby, not C,
so that is a lot of Ruby lines to parse.

I don't think he was talking about parsing speed there; he wrote that
"classes are cached".
The advantage to something like Kwartz is that it is written in C, so it
fundamentally pretty fast.

No, it generates Ruby code.
Because of the amount of time that threads spend waiting on other resources,
even with the heavy .3 seconds/request pages, though, I can handle 15-20 of
those per second on this hardware while more typical pages end up
benchmarking around 30-35 per second and the really lightweight ones around
70/second.

Sounds not bad, maybe I should have a look at it.
 
K

Kirk Haines

I don't think he was talking about parsing speed there; he wrote that
"classes are cached".

Maybe I misunderstood. My impression was that he was talking about the
startup time of a CGI being longer under Ruby than PHP, but that it's a bit
of an apples and oranges comparison since most of the Ruby libs are written
in Ruby and a lot of the PHP libs are .so's written in C.

I was just saying that if one eliminates that from the equation using some
sort of persistence for the Ruby code, then the comparison gets much better.
No, it generates Ruby code.

Guh, you're right. To many parsing systems in my head. LOL. Thanks. I
think that I was thinking of Clearsilver.


Thanks,

Kirk Haines
 
L

Lothar Scholz

Hello Kirk,


KH> Guh, you're right. To many parsing systems in my head. LOL. Thanks. I
KH> think that I was thinking of Clearsilver.

Did you try Clearsilver ?
If yes, can you recommend it ?

KH> Thanks,

KH> Kirk Haines
 
K

Kent Sibilev

I'm using Clearsilver with ruby-fcgi module to implement a commercial
web-site. It's very nice template engine indeed. So far I'm very
pleasant with the performance.

Cheers,
Kent.
 
P

Patrick May

Just that they do so does not mean that shared mod_ruby hosting is now
working. in a shared hosting environment.

They simply leave there customers alone with the problems, only to add
a new item on there marketing feature list.

Well, I haven't fiddle much with mod_ruby. But I have had the opposite
impression of their service. Sorry to hear that things didn't go well.
My experiences with them have always been positive.

Cheers,

Patrick
 
J

Jim Marshall

Try Kattare.com, they've told me they do mod_ruby hosting.

Cheers,

Patrick

How about using a host that does "virtual (private|dedicated)"
hosting via User Mode Linux or Virtuozzo?

I started up a $20 a month account recently with http://jvds.com .
For that, I have root on a "virtual" UML machine, so I was able to
install mod_ruby with no problems, since there is no one else sharing
my install with me. For that matter, I could just as well run webrick
or webrick-using software like Instiki. I could even run webrick on
port 80 if I wanted to.

I mention it because I looked at that kattare.com site, and it seems
to me that a UML setup is a much better deal. At kattare, the $20 a
month package includes 500MB disk space and 2Gigs/month
bandwidth. That jvds.com place I mentioned gives you 3 gigs disk
space and 20Gigs/month for that same price, *plus* you can install
and run whatever you want. You can even choose from among 7 or 8
different linux distros, or FreeBSD if you'd like.

Now, I know that it is very often the case that "you get what you pay
for" in web hosting, but this jvds.com place has nothing but good buzz
at http://webhostingtalk.com , from what I saw. Further, there are
several other places that offer a similar (or even slightly better)
deal for the same price, with that same "virtual root" setup. Among
them are http://www.linode.com (very nice-looking control panel that
lets you wipe and change your distro among other things),
http://www.rimuhosting.com , and http://www.powervps.com . Again, all
have good reputations on the aforementioned bulletin board and on the
net in general, from what I can tell, and any will let you run mod-ruby
and whatever else you might want. Finally, pretty much all of these
places have a 30-day money back guarantee, and several have no setup
fee.

It's true that you are only guaranteed 64 megs of memory with the $20
package I mentioned, but that's a *guarantee*, and, when the other
"virtual servers" on your physical server aren't using up their
memory, then any swap your machine is using is mapped right into the
machine's physical memory. Likewise, while you are only guaranteed a
small slice of the physical machine's cpus, you get as much as you can
use when other virtual servers aren't working them. I've compiled a
couple pretty big Haskell programs with the notoriously memory- and
cpu-hungry GHC, and both times the compilation flew right along.

Just thought I'd throw another option out there in case anybody was
looking and not aware of this one.
--
 
P

Patrick May

How about using a host that does "virtual (private|dedicated)"
hosting via User Mode Linux or Virtuozzo?

I have one of those too :) I use kattare.com because I have been
satisfied with their overall service, I like many of their member's
tools. And I use a virtual server for things that are more esoteric
that I want to manage myself. For example, www.narf-lib.org runs at
kattare, and svn.narf-lib.org runs at on a virtual server at
johncompanies.

I haven't had the time to get mod_ruby together. I need to ensure narf
plays well with it (as well as with fast cgi, and webrick)

Cheers,

Patrick
 

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,780
Messages
2,569,611
Members
45,280
Latest member
BGBBrock56

Latest Threads

Top