Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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!

share|improve this question

marked as duplicate by Michael Hampton, Magellan, Scott Pack, John Gardeniers, Iain Oct 17 '12 at 19:40

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

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 7:32

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.

share|improve this answer
Thanks for your quick answer ! It looks like HaProxy now configuration for link[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 7:30

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