2
  • If the port of my upstream's backend is closed, usually nginx fail very quickly and try the other backend, in the error log I can see

connect() failed (111: Connection refused) while connecting to upstream

  • If my upstream's backend is down and there is no route to the host, nginx fail very slowly (~3 seconds) and causing delay in term of user experience, and in the error log I can see

connect() failed (113: No route to host) while connecting to upstream

So, it is possible to reduce the 3 seconds delay when nginx found out that the backend is not available?

MadHatter
  • 81,580
Ryan
  • 6,271

1 Answers1

1

The answer is NO. This is system timeout for allow routers decide that destination is unreachable for your machine.

But you can write service-prober (if your backends are known), which will probe services and if make embedded OS firewall answer instantly with ICMP host-unreachable message through iptables or ipfw.

madlynx
  • 171