HAPROXY vs NGINX - 10,000 requests while killing servers @learncodeacademy
HAPROXY vs NGINX - 10,000 requests while killing servers  @learncodeacademy
Uploaded October 2014 | Updated September 2026, 1 week ago
"Which is better? NGINX or HAPROXY?"
There's no easy answer...however, here's a real-life test-case of what happens during a multi-server deployment scenario:

Thousands of requests are pouring in, and we make a deployment:
- take one server out of the cluster at a time
- deploy application
- restart the server

The results?

Server re-entry to cluster:
- HAProxy revisits the dead server almost immediately after it restarts.
- Nginx waits a while before revisiting the server

Failed Requests:
- HAProxy always fails 50-80 requests in this test case
- Nginx fails 0 requests - it will only fail requests if you take 2 of the 3 servers down at the same time, in which case you will get the similar result of 50-80 failed requests

Speed:
- Nginx consistently delivers slightly better results on this scenario, despite keeping one node out of the cluster for a while



NGINX Configuration:
server {
listen 80;
location / {
proxy_pass http://nodecluster;
}
}
upstream nodecluster {
server 22.22.22.2:3000;
server 22.22.22.3:3000;
server 22.22.22.5:3000;
}


HAProxy Configuration:
frontend http
bind *:80
mode http

default_backend web-backend

backend web-backend
balance roundrobin
mode http
server web1 22.22.22.2:3000 check
server web2 22.22.22.3:3000 check
server web3 22.22.22.5:3000 check

Song credit: amazon.com/Baby-Come-Back-To-Instrumental/dp/B00864UJCG

-~-~~-~~~-~~-~-
Also watch: "Responsive Design Tutorial - Tips for making web sites look great on any device"
youtube.com/watch?v=fgOO9YUFlGI
-~-~~-~~~-~~-~-
HAPROXY vs NGINX - 10,000 requests while killing serversComplete Docker Course! - Real World Docker - Complete Docker Tutorial CourseWATCH THIS IF YOU WANT TO BECOME A WEB DEVELOPER! - Web Development Career adviceHow to send server email with Node.js - sendgrid, mandrill, mailgun, etc.
LearnCode.academy |

HAPROXY vs NGINX - 10,000 requests while killing servers

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER