Describe the bug
When using home-assistant and nginx with zstd compression, nginx's service worker becomes unresposive once a request is made to home-assistant.
Steps To Reproduce
Steps to reproduce the behavior:
- Enable
home-assistant with nginx as a reverse proxy:
{
services = {
home-assistant = {
enable = true;
config = {
default_config = { };
http = {
server_host = [ "127.0.0.1" ];
trusted_proxies = [ "127.0.0.1" ];
use_x_forwarded_for = true;
};
};
};
nginx = {
enable = true;
recommendedProxySettings = true;
recommendedZstdSettings = true;
virtualHosts."example.org" = {
extraConfig = # nginx
''
proxy_buffering off;
'';
locations."/" = {
proxyPass = "http://127.0.0.1:8123";
proxyWebsockets = true;
};
};
};
};
}
- Make a request to
home-assistant
- Watch the
nginx process go up to 100% CPU consumption.
- Restarting
nginx fixes it temporarily but a new request to home-assistant causes the spinloop to happen again.
- Add
zstd off; to home-assistant's virtualHosts.extraConfig and watch the problem go away.
Expected behavior
I wanted a warning or some documentation indicating that zstd and home-assistant did not work well together.
Additional context
- Core dumping the
nginx worker process shows it is stuck during zstd compresssion.
- I came across this when I installed
home-assistant on a server that had harmonia on it, but harmonia as of a recent commit no longer needs zstd compression.
Metadata
❯ nix run nixpkgs#nix-info -- -m
- system: `"x86_64-linux"`
- host os: `Linux 6.6.60, NixOS, 24.11 (Vicuna), 24.11.20241123.0c58267`
- multi-user?: `yes`
- sandbox: `yes`
- version: `nix-env (Lix, like Nix) 2.91.1
System type: x86_64-linux
Additional system types: i686-linux, x86_64-v1-linux, x86_64-v2-linux, x86_64-v3-linux
Features: gc, signed-caches
System configuration file: /etc/nix/nix.conf
User configuration files: /home/jalil/.config/nix/nix.conf:/etc/xdg/nix/nix.conf:/home/jalil/.nix-profile/etc/xdg/nix/nix.conf:/nix/profile/etc/xdg/nix/nix.conf:/home/jalil/.local/state/nix/profile/etc/xdg/nix/nix.conf:/etc/profiles/per-user/jalil/etc/xdg/nix/nix.conf:/nix/var/nix/profiles/default/etc/xdg/nix/nix.conf:/run/current-system/sw/etc/xdg/nix/nix.conf
Store directory: /nix/store
State directory: /nix/var/nix
Data directory: /nix/store/j6f86lyxvw2iig2vxzgd4aib0r6jf0z7-lix-2.91.1/share`
- nixpkgs: `/nix/store/fnbr9s78sy4islw83vsaf0hgf88hih5v-source`
Notify maintainers
Note for maintainers: Please tag this issue in your PR.
Add a 👍 reaction to issues you find important.
Describe the bug
When using
home-assistantandnginxwithzstdcompression,nginx's service worker becomes unresposive once a request is made tohome-assistant.Steps To Reproduce
Steps to reproduce the behavior:
home-assistantwithnginxas a reverse proxy:home-assistantnginxprocess go up to 100% CPU consumption.nginxfixes it temporarily but a new request tohome-assistantcauses the spinloop to happen again.zstd off;tohome-assistant'svirtualHosts.extraConfigand watch the problem go away.Expected behavior
I wanted a warning or some documentation indicating that
zstdandhome-assistantdid not work well together.Additional context
nginxworker process shows it is stuck duringzstdcompresssion.home-assistanton a server that hadharmoniaon it, butharmoniaas of a recent commit no longer needszstdcompression.Metadata
Notify maintainers
nginx: @fpletz @RaitoBezarius @dasJ @Conni2461home-assistant: @fabaff @mweinelt @Mic92Note for maintainers: Please tag this issue in your PR.
Add a 👍 reaction to issues you find important.