0

I have an Apache web application which is serving ~2k Requests Per Minute. The current infrastructure includes two servers, one acting as Apache + database, and the second one just database.

I'm trying to evaluate the added value from moving the Apache to its own server and/or maybe even a couple of small instances and a load balancer.

How can I perform such evaluation? I'm using New Relic for server monitoring and seeing most (~70%) of the app server time spent is in PHP.

Noam
  • 129
  • 1
  • 7
  • Any memory exhausted info into the error_log? – fsoppelsa Nov 15 '13 at 15:14
  • You've already started down the right road by using New Relic. Instrument your system, benchmark it, find the bottlenecks, and then resolve them (either by improving the system/code, or adding more machines to share the load). – voretaq7 Nov 15 '13 at 18:36

1 Answers1

0

It is a pretty standard n+1 architecture you are describing. It will certainly provide you with many scaling options going forward.

Many of our services run on similar format

  • LB - with stateless routing if possible
  • Multiple Apache servers - these will need a Apache, PHP etc and the MySQL client libs installed.
  • DB Server - MySQL

This format also benefits from providing the ability for a Apache instance to be taken down for updates and allowing the site to remain live (you must consider how you manage data changes).

You mentioned a small instance - if you are in AWS - you can use their elastic load balancer in front of your Apache instances - it works extremely well. They also offer MySQL DBs as a service too.

New relic has plugins for all aspects so you can monitor load across each element of the infrastructure.

There are also many options available to scale MySQL - we find read only slaves very effective for our applications.

  • While I strongly recommend you to move towards this architecture if scaling is going to be a issue for you. It is also always worth tuning PHP - reducing memory footprints can provide significant benefits. As can caching - APC and Redis have also provided us with significant benefits. – BillyBigPotatoes Nov 15 '13 at 14:33