4.2. NGINX

  1. NGINX is the second de-facto standard HTTP server. Just like Apache, it covers a
  2. wide range of features. NGINX is built on a similar model as HAProxy so it has
  3. no problem dealing with tens of thousands of concurrent connections. When used
  4. as a gateway to some applications (e.g. using the included PHP FPM) it can often
  5. be beneficial to set up some frontend connection limiting to reduce the load
  6. on the PHP application. HAProxy will clearly be useful there both as a regular
  7. load balancer and as the traffic regulator to speed up PHP by decongesting
  8. it. Also since both products use very little CPU thanks to their event-driven
  9. architecture, it's often easy to install both of them on the same system. NGINX
  10. implements HAProxy's PROXY protocol, thus it is easy for HAProxy to pass the
  11. client's connection information to NGINX so that the application gets all the
  12. relevant information. Some benchmarks have also shown that for large static
  13. file serving, implementing consistent hash on HAProxy in front of NGINX can be
  14. beneficial by optimizing the OS' cache hit ratio, which is basically multiplied
  15. by the number of server nodes.