Performance Issues with Ngnix

To support some advanced features that I need for my network, I had to move from the Ngnix add-on to an HAProxy instance running on another server. To my surprise, hassio became much quicker and snapier. I double-checked by reactivating Nginx and the difference is noticeable.

Now I have some questions:

  1. Is the a known thing? I couldn’t find a single person complaining about it.
  2. If it’s not a known thing, can I help the team by providing metrics? If yes, what metrics do you need?

Cheers!

What hardware were you running home assistant and ngnix on?

What are you running the new proxy on?

Good question! I should have mentioned this before. Hassio running on docker on a i5 NUC with 16 GB of RAM. The new proxy is running on a Raspberry Pi 4 Model B with 4GB of RAM.

Any other cpu intensive addons installed, like Motioneye or Unifi?

Nope. Unifi runs on its own hardware and none of the add-ons are that intensive.

I have a guess: SSL termination. HAroxy is terminating SSL and no need to decrypt further requests from a certified client. Processing is offloaded to the RPB4. On the other hand, Nginx, because it sits in a container on the same server as hassio, it share the same resources for SSL termination.

I thing my guess could be the answer for the performance difference:

Source: https://www.loggly.com/blog/benchmarking-5-popular-load-balancers-nginx-haproxy-envoy-traefik-and-alb/