4 ms·
Nice article, although I would like to point 2 things: 1) The line for creating virtualenv is really missing. Also, you would probably like to point out that i
by piotrSikora 16y ago
Nice article, although I would like to point 2 things:
1) The line for creating virtualenv is really missing. Also, you would probably like to point out that it should be create with "--no-site-packages" (at least that's the way I prefer to do it).
2) Why there is Varnish in front of nginx? I see this mistake repeated again and again...
- StavrosK 16y ago1) pip creates the virtualenv if it doesn't exist, and uses --no-site-packages by default (as far as I know, anyway). 2) Why not? Varnish is awesome. Is nginx as flexible as Varnish when it comes to caching?
- piotrSikora 16y ago1) Sorry, my bad... Usually I've got only setuptools and virtualenv globally installed, so pip is not available outside of virtualenv. 2) I know that Varnish is awesome, don't get me wrong. But for the most use cases putting Varnish in front of nginx doesn't add any benefits... nginx on its own can handle pretty much all standard caching use cases, so Varnish is adding only a little of per-request overhead. Of course YMMV ;)
- StavrosK 16y agoI agree, varnish in front of nginx might be a bit overkill. We use varnish because we run apache, and I'm so infatuated with it that I recommend it to everyone. I've seen it pull off thousands of requests a second without breaking a sweat, then again nginx is no sloth either. We are considering switching from apache, but the current setup works so well that we don't want to mess with it :)
- piotrSikora 16y agoWell, if your setup (Varnish+Apache) works for you then there is no need to change it (unless you really need to). However, recommending this (Varnish+nginx) just leads to more people repeating the same mistake.
- bad_user 16y agoVarnish can also act as a (pretty good) load-balancer for your HTTP servers.
- piotrSikora 16y agoSo can nginx... And it's probably a lot better at it because of number of 3rd-party load balancers and supported backend protocols (HTTP, FastCGI, SCGI, uwsgi, AJP, PostgreSQL, Drizzle, MySQL, memcached, redis and then some more... ;)).