Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We run a newspaper-style site and are consolidating our architecture from one that grew amorphously into a more scalable, resiliant solution.

I was thinking of the following:

h/w firewall
h/w load balancer
    |        |
    |     control server (nagios, mail server & misc)   
pair of nginx load-balancing reverse caching proxies
    |                                  |
pair of apache app servers          pair of mogilefs storage nodes
and mogilefs trackers
 pair of mysql dbs (master/slave)
 and mogilefs db

all machines will run 64-bit centos.

We need to be able to service 7 simultaneous users on the app servers, and serve 840 static files per second. So I was thinking of speccing things out like below:

  • mogilefs storage nodes - 2GB RAM, Intel Atom (1.6GHz)
  • app servers - 8GB RAM, AMD Athlon II X2 (2.8GHz)
  • reverse proxies & control server - 4GB RAM, AMD Athlon II X2 (2.8GHz)
  • dbs - 8GB RAM, AMD Phenom II X6 (2.8GHz)

All would have 7.2krpm disks. There's not a huge amount of data in the database, so it can basically all be cached in buffers. Plus we only have around a 15% memcached miss rate, so there's not a huge load on the db.

A future stage would be round-robin DNS with everything mirrored to a different data centre.

Is there anything missing from this topology? Has anyone done anything similar with any of the components? Do the machines seem like they're under-/over-specced?



A bit more info:

7 simultaneous page views per second to be served by apache - a lot of the cms content is cached anyway, on disk & using memcached where possible. 840 static files need serving per second - but this may be a little too high since with far-future expiry dates only a fraction of page views will be with cold caches on the client.

The only admins will upload static content to the mogilefs storage nodes. They might upload ~100 files per day. I'm new to mogilefs - they'll just use commodity disks (7.2krpm)

This content will then be accessed via http://static*.ourdomain... Nginx will proxy the request to this content and cache it locally so while the first retrieval may be a little slow, subsequent retrievals will come from the nginx cache.

share|improve this question
up vote 1 down vote accepted

This is a bit too general to ask in a simple question. You will need to provide a lot more input on your proposed solution and on the load:

  • What load (pages/cached pages/assets) will be served by what software in this stack (nginx, mogilefs, localfs, apache)? What will the loadbalancer do, what type is it?
  • What CMS will you be using? How does it interact with mogile? What kind of storage will your mogilefs run on?
  • While you can run mogile happy on 2Gb nodes and apache on 4Gb, I would not skimp on RAM. More memory will make a lot of things smoother.
  • You don't mention CPU's, this is even more important in the CMS-picture

Also, I don't see any memcached in there; depending on the setup that could be useful.

7 simultaneous users does not sound a lot, how many pageviews per second is that in your view?

Edit to reflect the new info:

There are a lot of details to flesh out, but this appears to be reasonable. A lot will depend on how you configure the nginx caching and the CMS. Keep the network in mind as well, I'd suggest at least gigabit.

I'm a bit concerned with the mogilefs performance. If you are still in the design phase, I would suggest looking at alternatives (maybe direct filesystem replication) or future migration scenarios, depending on your requirements.

Also, your loadbalancer is presently a very highlevel element in the design. Untill you are very sure of the requirements in terms of performance and features, I'd leave all the options on the table there.

share|improve this answer
I've added more info – timmy Aug 18 '10 at 9:46
OK, thanks. MogileFS is the unknown for me too. I could just make 2 machines rsync a directory and use UCARP to decide which is the master... that might give better performance. And since content will be cached by nginx, I don't think it should be a huge problem either way. As for the LB, I'm expecting the hosting provider to offer access to a shared h/w load balancer. If not, we'll go with some software. Thanks for your feedback. – timmy Aug 18 '10 at 13:35
This also has the advantage it is much simpler. If you carefully document where you read and write to the system, you could later swap it out for another solution (MogileFS, or gluster, or by then probably ceph) – Joris Aug 18 '10 at 15:13

You're doing ~7 page req/s from the (dynamic) webservers, and ~850 req/s for (smallfile) static content, and for this you need a multi-layered architecture with ~10 servers?

Just off the top of my head, that sounds way too slow. Either you're overbuilding, or your site has some slow slow code, or something else?

I would propose to benchmark your application thoroughly, and from that build an estimate on what hardware you need for your load.

A few thoughts:

  • Having 2 load balacing layers is additional complexity, is that needed? How about just one HW load balancer, and a single cache server (Squid or Varnish).

  • Never use Atom CPUs for real servers, they are way underpowered.

  • I don't see why you want to use old desktop class CPUs like dual-core Athlons. Modern quad-core server CPUs are at least 2x faster in real use. Using modern more powerful hardware would allow you to consolidate layers and simplify your architecture.

  • MogileFS is probably great; I don't know much about it except its origin and that it has been in heavy use for years with great success. But why set up a technology you're not familiar with just to scale to 2 servers? If you just need the performance level of 2 servers with Intel Atom CPUs, then ditch that config, and get a single modern quadcore server with a fast disk subsystem (4 or 8 disk RAID 10, or SSDs) instead.


  • Benchmark your own application and get the best metrics you can for your real-life cache hit ratio.
  • Maybe find a consultant who has set up something like this several times before, and work together with him about final design?

Your architecture above is sound and well considered. But get some numbers for the real-life performance of the individual parts. :-)

share|improve this answer
You took the words right outta my mouth. Why 2 load balancers? Never use Atom CPUs in a server. Why use outdated desktop CPUs in a server application? 850 req/sec could be handled by a virtually anything, so what's wrong with the current code? – Mark Henderson Aug 22 '10 at 21:34
Yes, it all looks heavily overspecced. TBH, 3-4 servers would do the job - a static, DB and 2 front-end web servers. The code is fast - there's no need to do this to improve performance. This is really a HA set-up with the ability to scale different parts individually. I agree about MogileFS - I think I will drop that in favour of rsync. Also, there's about a £100 per month difference between Athlons and Xeons, so I thought we could just add more servers if we needed them. – timmy Aug 23 '10 at 8:47

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.