Skip to content

Conversation

ha11owed
Copy link
Contributor

A burst of connections that causes the maximum number of file descriptors to be reached will cause the server to stop.
Instead of stopping, the server could retry after a short timeout (the pull request). More complex mechanisms could also be implemented.

Steps to simulate the problem:

  1. Trigger more than 1024 parallel connections.
    for example by calling "ab -r -n 90000 -c 1000 http://localhost:8888/index.html" in two separate processes (terminals).
  2. Wait for the burst to be done (now no more connections to the server are active)
  3. The server stopped! NOK

@yhirose
Copy link
Owner

yhirose commented Sep 30, 2019

@ha11owed, thanks for your fine contribution!

@yhirose yhirose merged commit 46466b1 into yhirose:master Sep 30, 2019
@PixlRainbow
Copy link
Contributor

thanks! this may help reduce chance of #115 recurring

ExclusiveOrange pushed a commit to ExclusiveOrange/cpp-httplib-exor that referenced this pull request May 2, 2023
Don't exit if accept fails due to no more file descriptors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants