The speed of Rails

Hello guys.

Recently I have been developing a website using Rails. I come from a PHP
background, a very experienced one to say the least, and have been
developing for quite some time now. In PHP I have a framework quite like
Rails, although at the time of writing it I had no clue Rails even
existed. It shares the same basic concept of routing and a strong
database back-end. Here is a comparison of two sites I have developed,
the second one (Rails one) still under construction:

CounterMail - protecting your privacy - encrypted pgp email webmail - PHP
http://www.joshgilman.com/articles/index - Rails

I use standard 4MB/s cable connection via a wireless router and the PHP
website takes about 1-2 seconds to load whereas the Rails website takes
a good 6-7 seconds to load. This speed is really killing me, and I’m not
sure it’s entirely Rails fault but rather part of my host’s fault. My
question is what’s a good host to have a Rails application on? Is this
the normal speed I should expect from a rails application? I would love
to continue with this application but with speeds like this I am already
considering switching over to PHP.

If anyone can make some suggestions to help me out here I would be very
greatful. Thank you.

Cheers,
Josh

I had a similar problem when I cut across to Ruby. I hadn’t realized
about preloading an application with webrick or mongrel.

On Jan 31, 1:41 pm, Josh G. [email protected]

On 1/30/07, Josh G. [email protected] wrote:

considering switching over to PHP.
Some standard questions:

Are you running production or development mode?
How is the app deployed (Webrick, Mongrel, FastCGI, CGI)?

unknown wrote:

On 1/30/07, Josh G. [email protected] wrote:

considering switching over to PHP.
Some standard questions:

Are you running production or development mode?
How is the app deployed (Webrick, Mongrel, FastCGI, CGI)?

I’m running in development and I believe it’s deployed in FastCGI, but
I’m not sure, my host does not explicitely say.

I’m running in development and I believe it’s deployed in FastCGI, but
I’m not sure, my host does not explicitely say.

So you realize that development is exponentially slower than production
mode? For one thing, all files are re-loaded at every single request
(handy in dev mode so you don’t have to restart anything, but slow).
There’s no caching. There’s a lot more logging which slows things down.
And other, slower differences I’m sure I’m forgetting.

Josh G. wrote:

unknown wrote:

On 1/30/07, Josh G. [email protected] wrote:

considering switching over to PHP.
Some standard questions:

Are you running production or development mode?
How is the app deployed (Webrick, Mongrel, FastCGI, CGI)?

I’m running in development and I believe it’s deployed in FastCGI, but
I’m not sure, my host does not explicitely say.

Switch to production mode and you should see a very large improvement.
In development all your models and controllers are reloaded on each
request, and in production the are read on bootup of the server and then
no more.

You should expect slowness in development mode due the large number of
files in a rails aplication. But in production the speed should be
comparable to PHP.

Josh G. wrote:

can someone make any suggestions for a host geared
towards Rails applications? That’s not overly priced, I am very limited
on money right now.

http://railsmachine.com/
http://textdrive.com

Alex W. wrote:

Josh G. wrote:

unknown wrote:

On 1/30/07, Josh G. [email protected] wrote:

considering switching over to PHP.
Some standard questions:

Are you running production or development mode?
How is the app deployed (Webrick, Mongrel, FastCGI, CGI)?

I’m running in development and I believe it’s deployed in FastCGI, but
I’m not sure, my host does not explicitely say.

Switch to production mode and you should see a very large improvement.
In development all your models and controllers are reloaded on each
request, and in production the are read on bootup of the server and then
no more.

You should expect slowness in development mode due the large number of
files in a rails aplication. But in production the speed should be
comparable to PHP.

How can you ensure it’s in production? I changed config/environment.rb
and uncommented:

ENV[‘RAILS_ENV’] ||= ‘production’

I notice a little bit of difference, still a little slow though for only
loading a few articles. Right now I am running off of NetFirms which is
pretty crappy, can someone make any suggestions for a host geared
towards Rails applications? That’s not overly priced, I am very limited
on money right now.

Try R.Playground. You will need to know more about your deployment
before
you can really figure out whether you have a performance problem.

John B. wrote:

I’m running in development and I believe it’s deployed in FastCGI, but
I’m not sure, my host does not explicitely say.


Posted via http://www.ruby-forum.com/.


View this message in context:
http://www.nabble.com/-Rails--The-speed-of-Rails-tf3145992.html#a8723172
Sent from the RubyOnRails Users mailing list archive at Nabble.com.

Steve R. wrote:

Try R.Playground. You will need to know more about your deployment
before
you can really figure out whether you have a performance problem.

John B. wrote:

I’m running in development and I believe it’s deployed in FastCGI, but
I’m not sure, my host does not explicitely say.


Posted via http://www.ruby-forum.com/.


View this message in context:
http://www.nabble.com/-Rails--The-speed-of-Rails-tf3145992.html#a8723172
Sent from the RubyOnRails Users mailing list archive at Nabble.com.

Now here’s my question. They offer two plans, one for $60 a month but no
support for lighttpd/mongrel servers and then one for $108 a month with
support for lighttpd/mongrel servers. Is it worth it to go all the way
to $108 for the servers for pay $60 and go with fastcgi?

Alex W. wrote:

Josh G. wrote:

can someone make any suggestions for a host geared
towards Rails applications? That’s not overly priced, I am very limited
on money right now.

http://railsmachine.com/
http://textdrive.com

railsmachine is too expensive and I heard textdrive sucked beyond
belief. I have been doing my own research and it doesn’t seem like there
is any real good ones out there that are not for enterprise applications
and charge you enterprise prices.

Take a look at a2hosting.com. I’ve been using them for about 6 months
now
for a dev environment at < $10/month . Excellent support. Very good
for
the $, IMO.

hth,
Bill

----- Original Message -----
From: “Josh G.” [email protected]
To: [email protected]
Sent: Tuesday, January 30, 2007 11:04 PM
Subject: [Rails] Re: The speed of Rails

You haven’t really specified what you are deploying, how much traffic
you
expect and so on. Planet Argon offers a very nice shared hosting
environment
at reasonable rates, but don’t expect to run Amazon-like traffic through
it.
RailsMachine and EngineYard have what appear to be great plans for
larger-scale apps or ones where you need guaranteed cycles. I’ve read
that
they’re worth what they charge.

The real question is this: Are you a dev who’s test-driving rails to see
how
it works ($5 developer plan) or are you pushing something live tomorrow
that
has to serve hundreds of thousands of pages a day without breaking a
sweat?

Rails hosting is not as commoditized as PHP and Perl (or any Windows)
hosting are. Deploying a Rails app requires more from your host and more
from you. If you are in development mode, it might be worth your while
to
get a bit of dev space on one of the less expensive hosts to try
different
deployments.

Hope this helps.

John B. wrote:

I’m not sure, my host does not explicitely say.
http://www.nabble.com/-Rails--The-speed-of-Rails-tf3145992.html#a8723172


View this message in context:
http://www.nabble.com/-Rails--The-speed-of-Rails-tf3145992.html#a8724156
Sent from the RubyOnRails Users mailing list archive at Nabble.com.

For a rundown of a few Rails hosting companies check out
http://www.railshostinginfo.com . There you can compare and review
several companies and you can also narrow your search by price.

Kind regards,

Nick

Since you had your app in ‘development’ mode, maybe a good question is
whether you are actually wanting to deploy this app or are still
‘developing’ it, or even just playing with Rails to learn. Unless you
are actually ready to publicly deploy - perhaps it would be cheapest,
fastest and best to simply ‘host’ it on your local machine.

I personally have had good experiences with ServInt for VPS hosting,
their plans start a little under $50 for a fully-managed server. Set
it up with LiteSpeed’s free server which has built in support for RoR
and you have a fairly easy to setup, easy to maintain server
configuration that still gives you cPanel if you should need such a
thing.

JP

On Jan 31, 12:04 am, Josh G. [email protected]

I am still kind of “playing” around with Rails, although I have plans of
deploying the current website I am creating once I finish it. I don’t
expect too much trafic, but I mean there are going to be a lot of people
searching through hundreds of articles and I don’t want it taking 10-15
seconds every search. It’s not really traffic I am worried about, just
the speed of the things the site is doing. This will me my first rails
application deployed.

If you can, splurge for a VPS at www.slicehost.com . Instead of
getting a $10/month shared hosting account, skip a few latte’s and get
a 256MB slice for $20/month, can’t beat it.

On Jan 31, 5:54 am, Josh G. [email protected]

On 1/31/07, Josh G. [email protected] wrote:

I am still kind of “playing” around with Rails, although I have plans of
deploying the current website I am creating once I finish it. I don’t
expect too much trafic, but I mean there are going to be a lot of people
searching through hundreds of articles and I don’t want it taking 10-15
seconds every search. It’s not really traffic I am worried about, just
the speed of the things the site is doing. This will me my first rails
application deployed.

Even development mode shouldn’t be that slow, unless you just have a
lot of queries on that page. If so, running on mongrel/fastcgi in
production won’t help much.


Rick O.
http://weblog.techno-weenie.net
http://mephistoblog.com

On Jan 30, 8:56 pm, Alex W. [email protected]
wrote:

Josh G. wrote:

can someone make any suggestions for a host geared
towards Rails applications? That’s not overly priced, I am very limited
on money right now.

http://railsmachine.com/http://textdrive.com


Posted viahttp://www.ruby-forum.com/.

I would suggest http://www.railshosting.org/#free_rails_hosting to get
a decent free account while you are testing the waters

On 1/31/07, Rick O. [email protected] wrote:

Even development mode shouldn’t be that slow, unless you just have a
lot of queries on that page. If so, running on mongrel/fastcgi in
production won’t help much.

I’m with Rick here; there’s probably a better way to do whatever it is
you’re trying to do.

Is the site this slow during development as well? All of it, or just a
single action?

Isak