Option 1 - Separated Servers
As mentioned in my previous post "Horizontally Scaling Drupal" some very bad experience finally allowed me to get open hands and chance to review options how to horizontally scale some Drupal based web sites.
Easiest option is to split on multiple servers apache, cache servers and MySQL. This option require at least 3 servers but lack ability to add increase resources in any other way except vertically; adding RAM & CPU to every server. Second problem here is each component is single point of failure. One server crashes, complete site is down. So with this we are not far from initial state :-(.
Second option is ability to add multiple server to each component. Since I didn’t know where site will be hosted and what do I have available (most important part is Load Balancer) created solutions required some extra servers for proxy/balancing purpose.
In order to be able to scale and add multiple web servers I used Apache load balancer, 2-3 web servers, 2 memcached servers, and powerful MySQL server (or some kind of MySQL cluster).
In order to be able to test above solution I created few Ubuntu servers VM's on my machine:
- Front end server running Apache load balancer
- For start 3 separated machines running Apache. On each machine I had installed APC cache.
- Two memcached servers.
- One MySQL server.
- File storage replication
- Move the caching mechanism to Memcached. Memcached can store all caching data in memory. So it doesn't use the MySQL tables any longer. Also, Memcached can run in a clustered environment, so no need to manually flush the remote cache. The Memcached Drupal module and Memcached daemon would take care of it.
- Because of the movement of caching to Memcached, databases would not be on heavy load any longer.