-
Notifications
You must be signed in to change notification settings - Fork 636
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
Slow websockets with Windows client #1300
Comments
So I had done second pass at testing this (+ reverting 9f817ae), and it looks like this mostly affects Windows. For example, using Linux machine / Android phone throughput is much higher and filling of ws queue does not happen as quick. Debug works okayish, but messages are still lost. Notable offender is What I'll try is to defer them until loop and add additional functions to the client, so it knows when initial config is not sent and what modules to expect at all (and re-request some if they did not arrive on connect) As for Windows issue, see: esp8266/Arduino#1577 |
Adding to that, using Regarding delay, |
Is there no way you can generate the data in the async callbacks of AsyncWebSocket? |
Can you elaborate please? I am blanking here. It sure does eat a lot memory with Windows when using current builds even when using OK WiFi, without sleep mode. Queue being unlimited adds to that and flashstrings malloc'ed twice in a row too. I will try low-mem lwip version + buffer, that seems like a obvious way to avoid Windows assumptions about acking and allow sending more data. I wonder if cpu speed will affect this too. edit: As a start, testing sending out if (root.containsKey("callback")) {
const uint8_t i = root.get<uint8_t>("callback");
if (i >= _ws_on_send_callbacks.size()) return;
wsSend(client_id, _ws_on_send_callbacks[i]);
return;
} Then, client sends out batch of requests: callback_size.forEach((_, n) => websock.send(JSON.stringify({"callback": n}))) Two Win10 clients with and without ACK delay fix (from issue mentioned above) work fine. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. |
Immediate issue fixed. |
Can you ceate pull request to ESPAsyncWebServer? I see similar issues. |
Thinking about 9f817ae / #896
optimistic_yield()
did not do what I assumed it did - it just yields if loop spent more time that time value it is given (in usec).Doing some testing with new ESPAsyncWebServer I got hit with queueing problem. As of me-no-dev/ESPAsyncWebServer@bed4146 queue limit for ws messages is 8, so messages dropped after some point.
Config difference from baseline
pio platform feature/stage (see #1260 for ldscripts generator)
esp8266/Arduino@5493552 / 2.4.2-85-ge5493552 / lwip2 high bandwidth
https://github.com/me-no-dev/ESPAsyncTCP#7e9ed22
https://github.com/me-no-dev/ESPAsyncWebServer#bed4146
For example, using `keys`. `AsyncWebSocket.cpp` sections with os_printf / ets_printf are commented out. Console output is filled with queue errors after some point and simple yield does not really help here as message objects are not yet purged.
*edit: original assumptions about delay, formatting*
The text was updated successfully, but these errors were encountered: