New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ingress proxy unpacks assest and work slowly #3339
Comments
Hey guys, may be you can help? @danielwelch @ciotlosm |
@frenck Hi, I am sorry that I "quoted" you directly in that issue, but I saw in the last HA shows that you use Z2M yourself. There is an issue with the frontend and ingress (which seems to be a part of HA supervisor). Maybe you face the problem yourself (you need to reload the frontend sometimes that it shows correctly) |
@Bascht74 i don't use z2m as an add-on. |
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. |
Keep alive |
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. |
Bump |
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. |
Keep alive |
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. |
Keep alive |
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. |
Keep alive |
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. |
bump. @danielwelch @ciotlosm can you take a look? |
Anybody out here? |
@balloob Hello Paul, normally HA issues are assigned by a bot, but here for the supervisor this doesn't seem to work. |
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. |
Still no reaction and no assignment. Is that right? |
Hey sorry for the delay on this one @Bascht74 . I'm digging into this now. So first thing I noticed is that the Dev tools for Z2M direct access on second refresh with cache allowed: Dev tools for Z2M ingress access on second refresh with cache allowed: Now for the other two parts. The response actually gets unpacked twice along the way to the client unfortunately. Since ingress everything from the HA frontend (including ingress requests) go to core first. Core then sees it is an ingress request and so passes it to supervisor. Supervisor then checks that it has a valid ingress session and if so passes it on to the addon. The process then runs in reverse for the response. The request handling makes sense but the response handling is a bit illogical. Core obviously has to process the response since it is often asked to be the TLS endpoint by users when they add their SSL certs to its HTTP config. But supervisor never has to handle SSL and is basically just pass through. When I asked about this it seems there's a limitation in aiohttp around this. We let aiohttp handle encoding and apparently it always decodes response, there is no way to pass a response straight through without decoding it. I can research that more as that seems like the obvious improvement, perhaps something has changed. Since supervisor currently has to decode the response it is currently leveraging that to decide whether to stream it in chunks or not: supervisor/supervisor/api/ingress.py Lines 189 to 219 in 0991f52
I'm suspicious that this is the source of your 0B responses but I'm having a hard time reproducing that. Do you still see that behavior? The thing that seems like the top priority here is why isn't the response gzipped? I definitely see exactly what you're talking about there. My understanding is that this should be handled by aiohttp. The request headers include the accepted encodings so it should be encoding the output in one of the accepted formats. That doesn't seem to be happening which is confusing, will look into why. |
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. |
Describe the issue you are experiencing
Hello from zigbee2mqtt team!
Recently many users started complaining that z2m frontend open slowly.
zigbee2mqtt/hassio-zigbee2mqtt#236
nurikk/zigbee2mqtt-frontend#1124
After some debugging i can see that when frontend is loaded through ingress proxy, it's loaded very slowly:
there are few symptoms:
Here're some screenshots
This how it looks if we request frontend directly, without ingress
First load (no cache)
After refresh
What is the used version of the Supervisor?
supervisor-2021.10.8
What type of installation are you running?
Home Assistant Supervised
Which operating system are you running on?
Debian
What is the version of your installed operating system?
Ubuntu 18.04.6 LTS
What version of Home Assistant Core is installed?
core-2021.11.5
Steps to reproduce the issue
Anything in the Supervisor logs that might be useful for us?
Additional information
nurikodd.duckdns.org.har.zip
Attached HAR archive from chrome dev tools
The text was updated successfully, but these errors were encountered: