Open briandilley opened 1 week ago
Sound like that for some reason the system is running out of free sockets or they are somehow blocked from reading or writing. If you don't have a specific reason to use keep alive and multiple open sockets I would suggest that you don't do that. The performance benefits are usually rather minimal while complicating things a a lot.
This may be also somehow related to how some browsers open another connection to be ready before it's even being used. This may cause sockets to just hang there before the browser times them out. But as said before there is rarely a real need to maintain multiple open connections.
The library intentionally leaves the connection management to the user as it's a complicated platform dependant matter.
Sometimes I notice that request processing simply wont work, but then all of a sudden will process all of the requests quickly one after another. It's as if the web server doesn't see any requests, and they're queued up somewhere and then all of a sudden they come through. This can even happen with a single request. I'm judging this based on when my endpoint handler gets called. At the top of the handler i write something to the console (with
ESP_LOGI(TAG, "...")
). I'll see my browser make the network request for a single HTTP request and it will just sit there without a response for upwards of ~30 seconds before I see my log entry and the request is serviced. The endpoint handler itself seems to be sufficiently fast though - it's just getting to that that seems to take a while. The weird part is that nothing seems to be frozen or halted anywhere - because I see other stuff going on. The other weird thing is that this seems to be intermittent - it doesn't always act this way, but it's consistent enough to be a PITA.Here's my processing code:
and some other relevant settings:
and an extremely simple example endpoint call that exhibits this behavior: