Hi all,
I’ve been spending quite a lot of time trying to install a decent RoR
server on my dedicated server (Ubuntu 6.06 LTS), and now, everything
works.
However, the performances are not really what I had expected… I would
like to know what you think about it.
Here is my config: 2GHz VIA proc, 1Gb RAM, SATA-II HD.
I have apt-got ruby 1.8.4, mysql5 and installed rails 1.1.4 by means of
rubygems (0.9.0). Then I installed the mysql extension (2.7}, mongrel
(0.3.13.3) and mongrel cluster (0.2.0) and uploaded my app.
Here is my mongrel_cluster.yml:
port: “8000”
environment: production
pid_file: log/mongrel.pid
servers: 3
Then, I compiled Apache2.2. Here are my configure options:
./configure --prefix=/usr/local/apache2 --enable-modules=‘alias asis
auth_basic auth_digest authn_file authz_user autoindex access cgi cgid
charset_lite dir env http imagemap include log_config mime negotiation
setenvif status deflate info proxy proxy_balancer rewrite so headers’
Not too much, and static only… I don’t see how I could improve this…
Now, here is my vhost config:
<VirtualHost *>
ServerName dedibox
DocumentRoot /home/noe/cukv3/public
<Directory “/home/noe/cukv3/public”>
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
<Proxy balancer://cukv3>
BalancerMember http://127.0.0.1:8000
BalancerMember http://127.0.0.1:8001
BalancerMember http://127.0.0.1:8002
ProxyPass /images !
ProxyPass /stylesheets !
ProxyPass /javascripts !
ProxyPass / balancer://cukv3/
ProxyPassReverse / balancer://cukv3/
The whole thing works, however, as I have said, I am not satisfied by
the performances… Here is what I get for a middle-complexity action,
which returns 10 articles from a given category (n-to-n relationship).
(In fact, mysql’s CPU usage never gets > 3%, so it is clearly ruby that
slows it down…)
These benches have been realized with apache bench, from the box itself.
So there is no delay due to the network. I know httperf is better, but I
couldn’t manage to get it to work, because it took too much CPU.
So, here are the results:
-
Direct connexion to a mongrel server:
1.1) Dynamic
ab -n 100 -c 10 127.0.0.1:8000/articles/list?category_id=2
Result: 5.70 #/s1.2) Static
ab -n 10000 -c 10 127.0.0.1:8000/stylesheets/img/logo.gif
Result: 439 #/s -
Through Apache2.2 and mod_proxy_balancer
2.1) Dynamic
ab -n 100 -c 10 127.0.0.1/articles/list?category_id=2
Result: 6.38 #/s2.2) Static
ab -n 100 -c 10 127.0.0.1/stylesheets/img/logo.gif
Result: 1703 #/s
Which seems to be unsufficient for production use…
So, what do you think? Is it normal? Did I do something wrong? In fact,
I would be interested in points of comparison, and thoughts about these
results.
Thank you very much!
Nauhaie
