0

We have around 10-15 different websites which at the moment are hosted on two Rackspace cloud servers with 4GB RAM. These two servers are totally independent of each other, we randomly choose a server for each new site.

We've recently launched a new site which is quite a memory hog, and has exhausted the memory on it's server several times since going up, causing it to crash. I'm looking into why this is within the site itself. But also I think there's a lot I can do with the server architecture. There are two obvious things I could do... Setup Varnish caching (the type of websites we have will benefit greatly from this). And setup load balancing between the two servers.

So to do this, I've proposed we get one new cloud instance. Now my question is what to do with it...

1) Set this up as another LAMP server, and get a load balancer from Rackspace (which are quite cheap) to load balance between all three. Each running their own version of Varnish to cache the sites.

2) Set up the new box as a Varnish caching layer, and get Varnish to do the load balancing between the two we currently have.

I really like the sound of option 2, as all the caching would happen in one place. We could also do some cool stuff within Varnish like get it to serve cached pages if all servers were down, and have generally greater control. Most of the website visitors are anonymous, so could be served a cached site. Most logged in users are editorial staff, so it's more important to prioritise high-availability.

But, in terms of maximising the available resource, I'm not sure what is the best thing to do.

1 Answer 1

4

Choose option 2 and then use a rackspace loadbalancer that does the following:

  • If varnish cache is up and alive direct all traffic to the varnish instance
  • If varnish is down load balance between the two remaining webservers

This prevents you from building a single point of failure but you need a reliable healthcheck in your loadbalancer configuration.

3
  • Thanks, agreed this is the best setup. However we don't have a database server, which means it will have to run on one of the load balanced LAMP servers, which still creates a single point of failure and defeats the point of load balancing. So I think we're not going for this approach at all now.
    – user280381
    Jun 25, 2013 at 11:05
  • set up a DB instance on both of the machines and use a product like percona cluster. and gone is your last spof :) Jun 25, 2013 at 11:08
  • Unfortunatley, Rackspace cloud load balancers can't do any type of "intelligent" switching, so it would require a hardware load balancer or something else.
    – user280381
    Aug 9, 2013 at 9:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .