OVH Community, your new community space.

High Availability/Scaling LAMP on the Cheap?


Ashley
30-11-2009, 00:11
Use rsync to copy your content across servers.

Now set up a special mysql class in php or use something like mysql proxy to make sure everything but read only queries go to the master MySQL server (which replicates the changes to the slaves).

Selects should be done on the local slaves etc.

You could use federated tables but they can be buggy and under-perform.

tim2718281
29-11-2009, 08:51
Quote Originally Posted by unclebob
But... how do I ensure my dynamic content (.php scripts, etc) is the same for every server in my pool? How would I update my dynamic content without downtime and simultaneously on all nodes? I have thought about a SAN, but this could be a performance bottleneck and a single point of failure.

Any ideas?
The basic principle is to separate delivery from activation.

So you have a directory structure that allows new content to be delivered to a directory that is not used; after delivery is complete, you rename the directories on all servers.

And backout is to rename them back again.

You can automate the renaming (eg using cron jobs) so it occurs on all servers at once.

Myatu
28-11-2009, 23:33
You could use DRBD and a heartbeat between the two (or more) servers, avoiding the SPF. You'd still have to deal with the possibility of bottlenecks though.

My personal fave, GlusterFS supports striping/networked replication between the "bricks". This is another avenue you can take (especially since it doesn't require alterations to the OVH kernels - so you're quicker to recover from a hard failure).

Razakel
28-11-2009, 21:27
Maybe try using rsync?

unclebob
28-11-2009, 21:03
I am trying to scale LAMP (w/ Lighttpd) as cheaply as possible.

This is what I have so far:

  • I have a CDN for my static content (images, javascript, etc)
  • I can set up a static IP that balances load to a pool of n virtual/physical servers
  • I can add more servers to the pool instantaneously when loads are high
  • I can set up a MySQL Cluster (for performance and redundancy)


But... how do I ensure my dynamic content (.php scripts, etc) is the same for every server in my pool? How would I update my dynamic content without downtime and simultaneously on all nodes? I have thought about a SAN, but this could be a performance bottleneck and a single point of failure.

Any ideas?