I currently have 4 web application servers (running on application) on Rackspace that sit behind a Load Balancer (on Rackspace). In front of the Load Balancer. The application itself makes moderate use of caching so I know this can be improved on quite a bit.
My current architecture:
RS Load Balancer (SSL Termination) -> 4 Web Servers (Apache) -> MySql
This set up was put in place before me and now I have the opportunity to clean things up a bit so I was thinking of either this:
Varnish -> HAProxy (reverse proxy, LB, SSL Termination) -> 4 Web Servers (nginx) -> Redis / MySql
OR
Varnish -> nginx (reverse proxy, LB, SSL Termination) -> 4 Web Servers (nginx) -> Redis / MySql
OR is it better to have Varnish behind the proxy and in front of each web server like so?:
nginx or HAProxy -> 4 Varnish Servers -> 4 Web Servers (nginx) -> Redis / MySql
I would also move my servers to Linode as they seem to provide better pricing and while I've heard mixed reviews of their load balancers (the call them "NodeBalancers"), I have heard great things about their service and reliability in general.
My questions are:
- Of the above, which set up makes more sense?
- Is there anything I should add — or replace?
- What type of hardware should I provision for Varnish?
- Is it okay to put Varnish on the same server as each web server?