My site is working on one web server (Apache+PHP, linux OS) and one DB server (MySQL) and it is facing a lot of traffic. I am planning to add additional web server beside the current one. I did not have experience with multiple web server setup so I need suggestions, advices or ideas about the best setup for two web servers.
Here some nice statistics about current web server:
The current Apache configuration is the following:
<IfModule prefork.c>
StartServers 8
MinSpareServers 5
MaxSpareServers 20
ServerLimit 1556
MaxClients 1556
MaxRequestsPerChild 2000
</IfModule>
While it may require some site modifications, you may want to consider moving static content to a separate domain/server. This would include content such as javascript, css, and images. This server should receive simpler requests devoid of cookies and authentication. As your site grows this site should be easy to scale up by cloning the server and adding additional IP addresses for the domain.
Dynamic content tends to be more difficult to scale out. This gets more difficult if you have sessions to track. Unless you tie users with sessions to a particular server, you will need to look at session replication.
As your site grows you will eventually need to look at scaling your database. Replication is one approach and works well for read-only or mostly read access.
Basically move your docroot to shared storage and mount it on both web nodes. You can do a file-based mount (ala NFS) or a (iSCSI) block-level mount ala Cluster File System like OCFS2.
Then put a load balancer in front of the web nodes and use sticky sessions.
It's kind of a categorical leap going from one web node to 2 or more.
NFS solution is easy to implement but performance degrades as you add web nodes (at which time migration to Cluster File System is indicated).