Forum: Ruby on Rails Scalability in RoR !!! Please reply ASAP

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
541538995d6e6471cbd20fd5be1a15e1?d=identicon&s=25 Hardik Shah (Guest)
on 2007-03-24 21:32
(Received via mailing list)
Hi all,

I am right now developing the customized web portal in RoR framework
and using MySQL as database.

I am facing the problem in terms of no. of users it can support.I am
hostong the application on a normal desktop configuration server which
is 80GB HDD and 1GB RAM.Now,as soon as it reaches around 100 users,the
CPU usage becomes 100% and the server stops responding.

Now,I am not able to figure out whether it is a problem of
1)Not using the connection pooling mechanism correctly in RoR
2)Not using the higher capacity server
3)Something else

Please post your feedback on this scalability issue.It will be very
helpful to me and my company.

Hardik Shah
57ca262d3f80efadc5163d5e1875c1ee?d=identicon&s=25 Todd Nine (Guest)
on 2007-03-24 22:01
(Received via mailing list)
What server OS are you running?  What server are you using, as well as
what database and the versions?
541538995d6e6471cbd20fd5be1a15e1?d=identicon&s=25 Hardik Shah (Guest)
on 2007-03-24 23:43
(Received via mailing list)
Hi Todd,

Thanks for the reply.Here are the details u asked.

Server OS :- Red Hat Enterprise Linux
Language :- Ruby 1.8.4
Framework :- Rails Framework 1.1.6
Database :- MySQL 5.0.24
Web Server :-  Apache 2.0.46 with Fast CGI 2.4.0 / mod_fast CGI

57ca262d3f80efadc5163d5e1875c1ee?d=identicon&s=25 Todd Nine (Guest)
on 2007-03-24 23:59
(Received via mailing list)
  If you're already done all of this, I apologize.  To be honest, I'm
new at
Ruby on Rails, however I've been developing enterprise level J2EE Apps
(minimum 10 web nodes in a cluster) for several years now.  Here are
steps you can take to evaluate where the problem is.

   1. Run the 'top' command, and see where you processor is spending the
   most time.  Is it in wait or idle state, most likely its in wait.
   2. Check your Memory and Swap in top, see if you're maxing out your
   RAM.  Swapping causes a lot of performance issue since you'll be
writing to
   3. Check which process takes the most % of your CPU time.  In my
   experience with ROR, its been the database.

If you database is spending the most time there are 3 options I can give

1. Evaluate and profile your code.  If you have a lot of associations
as has_many, or belongs_to, ROR will issue a query for each of these
associations as the page is loading.  You can improve performance by
fetching each one.  Take a look at the ActiveRecord API here  Look for the
":include" option.
2. Are you connecting to mysql via TCP IP or socket?  If you're
with TCP/IP, try using a socket.
3. If none of this helps you may want to separate your web node from
MySQL Node.  This isn't cheap, so your best bet is to make the code more

Hope this helps,
541538995d6e6471cbd20fd5be1a15e1?d=identicon&s=25 Hardik Shah (Guest)
on 2007-03-28 17:21
(Received via mailing list)
Thanks Tood,

I am forwarding ur details to my development team.I will update you
with the results they get by following the process mentioned by you.

This topic is locked and can not be replied to.