HAProxy vs Varnish

Get Advice Icon

Need advice about which tool to choose?Ask the StackShare community!

HAProxy
HAProxy

1.8K
1.1K
+ 1
475
Varnish
Varnish

10K
811
+ 1
354
Add tool

HAProxy vs Varnish: What are the differences?

Developers describe HAProxy as "The Reliable, High Performance TCP/HTTP Load Balancer". HAProxy (High Availability Proxy) is a free, very fast and reliable solution offering high availability, load balancing, and proxying for TCP and HTTP-based applications. On the other hand, Varnish is detailed as "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.

HAProxy belongs to "Load Balancer / Reverse Proxy" category of the tech stack, while Varnish can be primarily classified under "Web Cache".

"Load balancer", "High performance" and "Very fast" are the key factors why developers consider HAProxy; whereas "High-performance", "Very Fast" and "Very Stable" are the primary reasons why Varnish is favored.

Varnish is an open source tool with 908 GitHub stars and 216 GitHub forks. Here's a link to Varnish's open source repository on GitHub.

Pinterest, 9GAG, and Twitch are some of the popular companies that use Varnish, whereas HAProxy is used by Instagram, Dropbox, and Medium. Varnish has a broader approval, being mentioned in 1007 company stacks & 140 developers stacks; compared to HAProxy, which is listed in 457 company stacks and 211 developer stacks.

- No public GitHub repository available -

What is HAProxy?

HAProxy (High Availability Proxy) is a free, very fast and reliable solution offering high availability, load balancing, and proxying for TCP and HTTP-based applications.

What is Varnish?

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.
Get Advice Icon

Need advice about which tool to choose?Ask the StackShare community!

Why do developers choose HAProxy?
Why do developers choose Varnish?

Sign up to add, upvote and see more prosMake informed product decisions

    Be the first to leave a con
    What companies use HAProxy?
    What companies use Varnish?

    Sign up to get full access to all the companiesMake informed product decisions

    What tools integrate with HAProxy?
    What tools integrate with Varnish?

    Sign up to get full access to all the tool integrationsMake informed product decisions

    What are some alternatives to HAProxy and Varnish?
    nginx
    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.
    Traefik
    A modern HTTP reverse proxy and load balancer that makes deploying microservices easy. Traefik integrates with your existing infrastructure components and configures itself automatically and dynamically.
    Envoy
    Originally built at Lyft, Envoy is a high performance C++ distributed proxy designed for single services and applications, as well as a communication bus and “universal data plane” designed for large microservice “service mesh” architectures.
    Squid
    Squid reduces bandwidth and improves response times by caching and reusing frequently-requested web pages. Squid has extensive access controls and makes a great server accelerator. It runs on most available operating systems, including Windows and is licensed under the GNU GPL.
    Pound
    Pound was developed to enable distributing the load among several Web-servers and to allow for a convenient SSL wrapper for those Web servers that do not offer it natively.
    See all alternatives
    Decisions about HAProxy and Varnish
    HAProxy
    HAProxy
    Varnish
    Varnish
    Tornado
    Tornado
    Django
    Django
    Redis
    Redis
    RabbitMQ
    RabbitMQ
    nginx
    nginx
    Memcached
    Memcached
    MySQL
    MySQL
    Python
    Python
    Node.js
    Node.js

    Around the time of their Series A, Pinterest’s stack included Python and Django, with Tornado and Node.js as web servers. Memcached / Membase and Redis handled caching, with RabbitMQ handling queueing. Nginx, HAproxy and Varnish managed static-delivery and load-balancing, with persistent data storage handled by MySQL.

    See more
    Tom Klein
    Tom Klein
    CEO at Gentlent · | 9 upvotes · 33.4K views
    atGentlentGentlent
    Visual Studio Code
    Visual Studio Code
    npm
    npm
    Varnish
    Varnish
    HAProxy
    HAProxy
    Kubernetes
    Kubernetes
    Docker
    Docker
    GitLab
    GitLab
    GitHub
    GitHub
    Git
    Git

    We're using Git through GitHub for public repositories and GitLab for our private repositories due to its easy to use features. Docker and Kubernetes are a must have for our highly scalable infrastructure complimented by HAProxy with Varnish in front of it. We are using a lot of npm and Visual Studio Code in our development sessions.

    See more
    Interest over time
    Reviews of HAProxy and Varnish
    Review ofVarnishVarnish

    Thank you for posting such a great article! I found your website perfect for my needs. It contains wonderful and helpful posts. Keep up the good work!. Thank you for this wonderful Article! five nights at freddy's

    How developers use HAProxy and Varnish
    Avatar of Trello
    Trello uses HAProxyHAProxy

    We use HAProxy to load balance between our webservers. It balances TCP between the machines round robin and leaves everything else to Node.js, leaving the connections open with a reasonably long time to live to support WebSockets and re-use of a TCP connection for AJAX polling.

    Avatar of Pinterest
    Pinterest uses VarnishVarnish

    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.

    Avatar of The Independent
    The Independent uses VarnishVarnish

    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.

    Avatar of The Independent
    The Independent uses HAProxyHAProxy

    HAProxy manages internal and origin load balancing using KeepaliveD. Two small servers host the entire site, never moving about 15% load even during the largest load spikes.

    Avatar of Packet
    Packet uses HAProxyHAProxy

    We use HAProxy to balance traffic at various points in our stack, includgin nginx nodes on different physical machines, and api nodes on the backend.

    Avatar of ssshake
    ssshake uses HAProxyHAProxy

    I use HAproxy primarily for application routing and SSL termination. I also use its logs and statistics to visualize incoming traffic in Kibana.

    Avatar of Clarabridge Engage
    Clarabridge Engage uses HAProxyHAProxy

    We use HAProxy to load balance web requests for our web application, but also for some internal load balancing of microservices.

    Avatar of Hevelop
    Hevelop uses VarnishVarnish

    Varnish is the http cache proxy we use to achieve maximum performance on high traffic e-commerce.

    Avatar of Pruvit
    Pruvit uses VarnishVarnish

    Used as part of site hosting (Firebase HTTP Hosting manages implementation)

    Avatar of Reactor Digital
    Reactor Digital uses VarnishVarnish

    Caching static content requested by Drupal.

    How much does HAProxy cost?
    How much does Varnish cost?
    Pricing unavailable
    Pricing unavailable