-
Notifications
You must be signed in to change notification settings - Fork 13.3k
ESP8266WebServer: The problem with frequent simultaneous connections (early response closing, not timeout) #8904
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
Comments
The good news is that the esp did not freeze :) There is no appropriate api in webserver to call Otherwise you can try with an increased value of this define :
What I guess happens is that there are too many requests waiting. Starting from the 6th client requesting, lwIP does not anymore answer "please come in and wait for your turn" so the client sees as if there is no server behind the door. It is normally keeping trying for a little while ( |
I agree with that :)
It won't timeout, but instead:
Considering that rejected without being put in the backlog queue, it seems to be a reasonable result. OK, so let's define No, it's not right to force excessive simultaneous connections in the first place...
|
100 is like in the "no feature" selection, like infinity, and will fail / freeze / reboot because of OOM on high load.
These cases show that
You can try to monitor with
It should give the same result as when defining |
Oh, aha, I see, the backlog obviously needs memory :)
I think it would be very helpful if there was something in the |
It doesn't look like memory is a constraint... Modify the above MVCE
This allows you to visually track the remaining memory (requires a terminal that can handle backspace). But it seems that there is still enough memory left even during timeouts or other connection failures... |
Well, I apologize for not being able to present clear evidence here, but I would like to assert the following:
|
Finally, only one early-closing server response has ever been occurred with a quickly-made load testing about 1.6 million HTTP transactions by 5 concurrent connections. I'm still not able to personally convinced, but I'm going to close the issue. Thanks all. |
There seems to be some kind of problem with the ESP8266WebServer, so I've reopened this issue. In general, timeouts in opening connections can be safely resolved by retries, but early closed responses after connection establishment cannot.
No special explanation needed, just a normal Python example of many HTTP connections - in fact, we can issue millions of requests on a single alone connection without any problems (except for timeouts).
What this exception trace suggests is that the connection was lost while trying to receive the status line (yes, the first line) of the HTTP response. FYI, adding the HTTP/1.1 |
#8944 seems to fix this issue as well :) |
Basic Infos
Platform
Settings in IDE
Problem Description
A moderate rate of unexpected HTTP (or socket) disconnections/timeouts is observed when trying to connect to the ESP8266WebServer at a high frequency.
But other HTTP servers belonging to the same WiFi do not see such disconnections/timeouts.
MCVE Sketch
Detailed Procedure
Whether or not a failure rate of 0.19% is appropriate is left to the judgment of each person...
The text was updated successfully, but these errors were encountered: