We have build a special interest social network and need to setup now the proper server setup for the webapp servers.
We have for the webapp 5 physical server available (2xE5645 CPU, 24 GB Ram, RAID, 4x Gbit NIC), one of the five server need to provide the API for our mobile visitors (iOS, Android). Our webapp need PHP, APC, Memcached and MySQL.
Also we have 4 more physical server inside (2xE5620, 12 GB Ram, RAID, 4x Gbit NIC):
Comet push server (custom server for the chat)
Queue/Mail server (beanstalkd)
static webserver (G-WAN webserver) with 2xDAS with 12x2TB (total 40 TB in Raid 6)
Apache webserver dedicated for HTTPS (this server can also be used for the LB cluster if the SSL secured page will be put on the LB cluster, is this better?).
For the beginning we only want to have the webapp server in LB/HA, because we don't have more servers available at the moment.
And a last is a low cost server (X3430, 4 GB Ram, RAID, 2x Gbit NIC) that is used for monitoring all Hardware.
We have 2x HP Procurve 2900 managed 48 port Gbit Switch.
All the above equipment stay in our Rack in a network center.
We use RHEL 6 on all servers.
I have much ideas, but I'm not really sure which will be the best way.
My direction is go the way to install HA Proxy and Apache webserver on two boxes, have on two boxes MySQL DB Server and on one both Apache and MySQL for the API/Webservice. To use one of the switch for private network where all server will be connected and used for internal communication (MySQL, File transfer after upload).
Is it helpful to connect multiple NIC ports per server to the Switch?
Is HA Proxy the best way for our case? Or would it be better to use nginx on 2 or 3 boxes and to use it for load balancing and serving PHP and have LVS or some similar for the HA part?
I'm open for all solutions, and the 5+1 server can be used flexible.
Thanks for any help.
UPDATE: After more research, I think it would be hard to find a solution to have HA for all Server. My actual idea for the setup is:
nginx as Proxy for load balancing (I will use one of the mid spec boxes)
3 Apache webserver on private net
2 MySQL Server Master/Slave on private net
In the above solution, the Apache Webserver will also host the SSL site for payout, I'm not sure if nginx can handle the SSL certificate for this different backend servers.
UPDATE 2: I have do more research, Redhat offers a Add-On for Load balancing based on LVS. http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Virtual_Server_Administration/ch-lvs-overview-VSA.html This Addon looks well, BUT I still don't know which way is the right one? Is it better to go with a nginx in front or with LVS or something other? Someone told me I can use the existing HP Procurve 2900 Switch for simple load balncing too....
LVS is designed for layer 4 load balancing. nginx or ha proxy are only used for layer 7( I mean web traffic) load balancing. Thus, I would like to suggest you use nginx or HA proxy as your load balancer if web traffic is your biggest work load. If max concurrent connections is your bottleneck, then I will recommend that you use HA proxy as your load balancer because HA proxy has better performance(Ref:http://affectioncode.wordpress.com/2008/06/11/comparing-nginx-and-haproxy-for-web-applications/).
HA for a webapp SHOULD be designed in from the start. Wish I had ever seen that happen :)
But seriously: You are asking for an active/active setup. The most important questions when deciding on such an architecture is how application data needs to or does not need to, can be or cannot be kept synchronous between the app servers. Also, HOW synchronous does it have to be, is there code that expects a change to be globally distributed before returning, are there areas in the application that can deal with a couple seconds state lag but not more (do not forget that mysql replication is of the second type!)? These needs and possibilities will dictate your setup. Scaling hardware comes later. And active/active is always difficult to graft onto anything that wasn't designed with it in mind.