2 ms·
> I have a perception of nginx being slimmer than HAproxy and more focused on http/https than HAproxy Oddly enough, I have the exact opposite perception. HAPro
by orthecreedence 9y ago
> I have a perception of nginx being slimmer than HAproxy and more focused on http/https than HAproxy
Oddly enough, I have the exact opposite perception. HAProxy doesn't even support logging to files because that would "block" the event loop, so it delegates to syslog. That seems fairly slim to me. The entire project is written with no compromises to support extreme numbers of connections efficiently. Nginx can do this as well, but has to be tuned a lot more to get to the same place, and I'm convinced if both were properly tuned and put in the same environment, HAProxy would come out ahead.
That said, if you're at a place where you already need/use Nginx, it might not make sense to use HAProxy if you can re-use your existing Nginx instances. However if you're in the market for a load balancer and Nginx isn't being used already, definitely check out HAProxy. It's pretty simple to configure.
EDIT: Another point for HAProxy: Recently, the job system we run (beanstalkd) was slowing to a crawl. I needed to find out where the slowdown was. The easiest way was to route the worker connections through HAProxy and enable logging and the HTTP stats page. I was able to determine the problem was in beanstalkd itself, not our workers (or a network issue). Sure there are a number of debugging proxies out there, but HAProxy was already installed and the logs it emits are the perfect balance of information so you can pick things apart without being overwhelmed. It really helped. Nginx wouldn't have been as useful, and would have taken a much longer time to configure.
- jsjohnst 9y ago> Oddly enough, I have the exact opposite perception. Ditto, especially if you consider the OpenResty "variant" of Nginx. Also, I realize Nginx does a good job of being a load balancer / reverse proxy, but to me it will always be a "web server" first. HAProxy on the other hand is built and optimized specifically to be a "load balancer / reverse proxy" first.