HAPROXY vs NGINX - 10,000 requests while killing servers

preview_player
Показать описание
"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"
-~-~~-~~~-~~-~-
Рекомендации по теме
Комментарии
Автор

Thank you for the music, really nice album! :)

theyruinedyoutubeagain
Автор

I would be quite interested in seeing these benchmarks revisited 7 years later

c.s.
Автор

Been watching a few of your videos... and keep wondering what is that tool you use to see all those requests? Like how long it takes etc etc...

DilidiZ
Автор

For future viewers, due to the misconfiguration, I don't think this is a fair comparison. I do think someone should make a video showing the performance with some optimal configuration for both. This doesn't answer the question "Which is better?" The correct question is "Which is better out of the box with bare-minimum configuration?"

ml
Автор

Intriguing, if lacking in explanation!

mkeii
Автор

see "option redispatch" and "retries" in haproxy documents

jakovsosic
Автор

Can you provide your setup and the test configuration? Thanks!

brianpayne
Автор

How does NGINX do that? Why doesnt it have any failed requests? Cheers Tom!

Mrkindleify
Автор

So in essence, HAProxy is better at managing nodes, but tends to let requests slip. Nginx is better at keeping all requests, and is a little faster. Is that correct?

corporalwaffles
Автор

NGINX+Linux default config or any tuning?

renedet
Автор

What benefits do you get from iTerm2 compared to Terminal?

LizardanNet
Автор

can you provide the code (preferably java) that was used to bombard these

ArvindGupta-filz
Автор

what is the command line that you use it to send sevral requests???

dhibihamma
Автор

Nice video, but you should try with "rise 2" in backend

diegofula
Автор

How were you sending all those requests to your server?

zachfiorito
Автор

Good question: What code language is that website using? Hahaha :)

YoureHot