0

Possible Duplicate:
Ordering: 1. nginx 2. varnish 3. haproxy 4. webserver?

Could you tell me if a configuration as below looks ok to serve pages delivered from my web servers. Is there some difficulty?

Requests --> HaProxy --> Varnish --> Nginx (frontend web server).

Is-it better to install varnish on my load balancers (haproxy) or on my web servers?

Cheers and thanks!

Nathan
  • 1
  • 1
  • 1
    The answer is whatever you need or want based on the specifics of your application. There is no strict better than the other. Additionally, if you are planning to use nginx anyway, you can have only nginx. nginx has load balancing and caching modules. You can skip haproxy and varnish entirely giving 2 less layers and 2 less things to go wrong. The three shares similar features, it's the question of do you even need the additional features the other one gives. – Grumpy Oct 14 '12 at 20:45
  • I understand, nginx everywhere should be nice too, but Haproxy is so sexy and I have some experience with that kind of load balancers, it is pretty easy to use and configure scripts to remove servers from clusters with some conditions. I've never used nginx as cache, I am a bit confused about it, have you a tutorial somewehere? – Nathan Oct 15 '12 at 07:32

1 Answers1

1

I run a rig which uses the configuration you've mentioned, and it runs fine. The only thing to take care of, is that if you want SSL; you could add an nginx in front to deal with SSL-termination.

Where to install Varnish? I would put them where I had the necessary memory / CPU cycles. In my case it is the load balancers, as they are dedicated for doing just that. If your application servers are specced very well, and your load balancers only have the capacity to push packets - then you may need to consider running Varnish on your frontend servers.

Kvisle
  • 4,113
  • 23
  • 25
  • Thanks for your quick answer ! It looks like HaProxy now configuration for [link](http://blog.exceliance.fr/2012/09/04/howto-ssl-native-in-haproxy)[link]. My servers have all 32GB ram, so I gonna install Varnish on my load balancers instead of my web servers. – Nathan Oct 15 '12 at 07:30