nginx vs Varnish: What are the differences?
nginx: A high performance free open source web server powering busiest sites on the Internet. nginx [engine x] is an HTTP and reverse proxy server, as well as a mail proxy server, written by Igor Sysoev. According to Netcraft nginx served or proxied 30.46% of the top million busiest sites in Jan 2018; Varnish: High-performance HTTP accelerator. Varnish Cache is a web application accelerator also known as a caching HTTP reverse proxy. You install it in front of any server that speaks HTTP and configure it to cache the contents. Varnish Cache is really, really fast. It typically speeds up delivery with a factor of 300 - 1000x, depending on your architecture.
nginx belongs to "Web Servers" category of the tech stack, while Varnish can be primarily classified under "Web Cache".
"High-performance http server", "Performance" and "Easy to configure" are the key factors why developers consider nginx; whereas "High-performance", "Very Fast" and "Very Stable" are the primary reasons why Varnish is favored.
nginx and Varnish are both open source tools. nginx with 9.11K GitHub stars and 3.44K forks on GitHub appears to be more popular than Varnish with 908 GitHub stars and 216 GitHub forks.
According to the StackShare community, nginx has a broader approval, being mentioned in 8676 company stacks & 2560 developers stacks; compared to Varnish, which is listed in 1006 company stacks and 140 developer stacks.
What is nginx?
What is Varnish?
Want advice about which of these to choose?Ask the StackShare community!
What are the cons of using nginx?
What are the cons of using Varnish?
What tools integrate with nginx?
What tools integrate with Varnish?
The original API performed a synchronous Nginx reload after provisioning a zone, which often took up to 30 seconds or longer. While important, this step shouldn’t block the response to the user (or API) that a new zone has been created, or block subsequent requests to adjust the zone. With the new API, an independent worker reloads Nginx configurations based on zone modifications.It’s like ordering a product online: don’t pause the purchase process until the product’s been shipped. Say the order has been created, and you can still cancel or modify shipping information. Meanwhile, the remaining steps are being handled behind the scenes. In our case, the zone provision happens instantly, and you can see the result in your control panel or API. Behind the scenes, the zone will be serving traffic within a minute.
Nginx serves as the loadbalancer, router and SSL terminator of cloudcraft.co. As one of our app server nodes is spun up, an Ansible orchestration script adds the new node dynamically to the nginx loadbalancer config which is then reloaded for a zero downtime seamless rolling deployment. By putting nginx in front or whatever web and API servers you might have, you gain a ton of flexibility. While previously I've cobbled together HAProxy and Stun as a poor man's loadbalancer, nginx just does a much better job and is far simpler in the long run.
Used nginx as exactly what it is great for: serving static content in a cache-friendly, load balanced manner.
It is exclusively for production web page hosting, we don't use nginx internally, only on the public-facing versions of static sites / Angular & Backbone/Marionette applications.
We use NGINX both as reverse HTTP proxy and also as a SMTP proxy, to handle incoming email.
We previously handled incoming email with Mandrill, and then later with AWS SES. Handling incoming email yourself is not that much more difficult and saves quite a bit on operational costs.
When you visit the site, you talk to a load balancer which chooses a varnish front-end which in turn talks to our web front-ends which used to run nine python processes. Each of these processes are serving the exact same version on any given web front-end.
NGINX sits in front of all of our web servers. It is fantastic at load balancing traffic as well as serving as a cache at times when under massive load. It's a robust tool that we're happy to have at the front lines of all Wirkn web apps.
Varnish sits as a secondary cache layer behind Akamai. Two servers operate in a Primary/Secondary configuration with failover managed by HAProxy. Requests peak at around 10k/s.
Varnish is the http cache proxy we use to achieve maximum performance on high traffic e-commerce.