Comments on this architectur?

Hi everyone,

I plan to deploy our web to an dedicated rootserver, using xen to
seperate the servers into several roles. I don’t have any experience
in deloying to an multi-slices environment. So your opionions on this
would be great!

The app:

  • highly interactive, no caching at the moment
  • avg. of 50k requests/day (mostly during office hours in europe)

The rootserver:

  • 4 GB of RAM
  • 2,67 GHz (Core2Duo)

Architecture:
5 XEN-Slices:

  1. web1 - nginx - Load-Balancing + Static files - 400MB RAM
  2. app1 - mongrel_cluster with 6 mongrels - 900MB RAM
  3. app2 - mongrel_cluster with 6 mongrels - 900MB RAM
  4. db1 - mysql - 1000-(whats left)MB RAM
  5. BackgroundDrb + (oneday) memcached + postfix (relay to external
    smtpserver) - 500MB RAM

Does this make sense to you? Or will the CPU be to small to handle
nginx+mysql+10 mongrels?

Is it recommanded to use a seperate BackgroundDrb-Server? Or should I
try to use one on every app-slice? Will they interfere with each
other?

  1. BackgroundDrb + (oneday) memcached + postfix (relay to external
    smtpserver) - 500MB RAM

Does this make sense to you? Or will the CPU be to small to handle
nginx+mysql+10 mongrels?
This really depends on your application. What I’ve seen happen
multiple times with new apps is that they eat much too much CPU for
the database due to not optimized queries (too many, not using indexes
or simply slow ones).

On the app server side we have seen more memory problems than CPU
issues, but that again depends on what your app is doing. Ours is
mainly displaying stuff so there is not too much work for the app CPU.

Webserver should be fine. If you run into trouble there you can think
about off-loading your static content to an asset host.

I would highly recommend installing a monitoring + graphing tool (we
use nagios + nagios-pnp) to watch your most important parameters like
CPU, RAM, load, response time, etc over time find out where your
bottlenecks are. Additionally enabling MySQL Slow Query Log with a
threshold of e.g. 10s as a start would help you track down your
slowest queries. If you’re lucky enough not to see any queries slower
than 10s you may lower the threshold step by step down to 1s (min
resolution of MySQL 5.0)

If your application is already well optimized that one box of your’s
should be ok. But you might want to think about having two such boxes
because of redundancy anyways. Then you could balance your VMs accross
both boxes (but make sure you still could run all of them on one box
only).

We’re currently serving 50k per day on two root servers having
DualCore 2.3 GHz and 2GB RAM each and the CPU is by far not the
bottleneck here (after doing our homework in database cleanup)

If you need some head start on setting up nagios + nagios-pnp I can
share some of our capistrano recipes for doing that on XEN VMs (same
for all other roles)

Best Regards,

Matthias

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs