filmov
tv
HAPROXY vs NGINX - 10,000 requests while killing servers

Показать описание
"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 / {
}
}
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
-~-~~-~~~-~~-~-
Also watch: "Responsive Design Tutorial - Tips for making web sites look great on any device"
-~-~~-~~~-~~-~-
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 / {
}
}
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
-~-~~-~~~-~~-~-
Also watch: "Responsive Design Tutorial - Tips for making web sites look great on any device"
-~-~~-~~~-~~-~-
Комментарии