-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Important delay with streams (Mozilla EventSource) #503
Comments
@Kernald hum, this weird... I would be very interested by reproducing this to investigate. |
@emilevauge The way I checked this was pretty simple, with curl: my home-assistant instance has been running for long (I was proxying it through nginx until recently). I noticed some delay in the UI, so I subscribed two I then sent some events from the web UI: the curl instance bound to the home-assistant webserver received them in a second. The other one, bound to Traefik, didn't until a long time (the home-assistant server send some pings every minute or so, some traffic is generated even when idling). I tried another approach: flood the stream with events. I turned the lights on, off, on… both curl instances got the data really quickly. That's why I'm thinking of a buffer waiting to be full before being flushed. Note that I didn't found anything relevant on Traefik's debug logs, nor on home-assistant's. I'm not a web developer at all, so I can't set up a sample web-server right now, but I'll definitely try. You can probably reproduce the issue with a blank home-assistant instance (as it's sending some ping even without any components), which is available on Docker. Don't hesitate if you need anything more until I can reproduce a minimal example! |
Thanks @Kernald for your explanations, I will try to reproduce this issue. |
I have a very basic API that uses HTML5 Server Sent Events (using the |
I created https://github.com/ashmckenzie/traefik_html5sse_example to replicate the issue 😄 |
@ashmckenzie thanks a lot ! |
Hi @emilevauge, I use the latest Traefik and it doesn't seem to work. My server sends Is there any option to disable buffering/caching/whatever completely? |
I have a similar issue, but with a generic content-type, not |
@kelunik Can you try with 1.5.0-rc2 ? |
@juliens Sure. Seems all fine there. 👍 |
I'm exposing through Traefik an home-assistant instance. It's using Mozilla's EventSource to send events back to the front-end.
If I'm accessing directly the home-assistant instance, events are nearly instant. If I access it through Traefik, they are sent, but with an important delay (between 30 seconds and a minute or two). It looks like a buffer flush occurs every x seconds: if I send a lot of events, they are sent quickly. If I only have one or two, they are queued for a while.
It may be a feature, but not documented anywhere (or at least I couldn't find it). If it is, is there any way to configure the behavior?
The text was updated successfully, but these errors were encountered: