Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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: processes apache memory load traffic

The current Apache configuration is the following:

<IfModule prefork.c>
StartServers       8
MinSpareServers    5
MaxSpareServers   20
ServerLimit      1556
MaxClients       1556
MaxRequestsPerChild  2000
</IfModule>
share|improve this question
    
Can you give more information about server & traffic ? How much clients (& number of connections as well) you have now ? what is your apache configuration ? and what is the bandwidth ? and are you serving dynamic website ? if yes are you using a custom php script or open source like wordpress, drupal etc. ? –  risyasin Sep 18 '11 at 19:49
    
Hi. I added some of the web server statistics. My site have around 100 000 thousands visitors per day and around one million page views. it is a custom PHP+MySQL script. it is like forum with image upload feature. RAM: 24676716k.CPU: Intel(R) Xeon(R) CPU E5620 @ 2.40GHz –  usef_ksa Sep 18 '11 at 20:18
add comment

2 Answers

up vote 3 down vote accepted

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.

share|improve this answer
add comment

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).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.