Skip to content
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

http: Increase listen backlog to 40 #50

Merged
merged 2 commits into from Mar 21, 2022
Merged

Conversation

nirs
Copy link
Member

@nirs nirs commented Mar 20, 2022

Both TCP and unix socket based servers inherited the listen backlog from
python socketserver.TCPServer. The default value (5) was never a
problem, but new automated tests using 16 concurrent connections started
to fail randomly recently with:

ERR: Traceback (most recent call last):
  ...
  File "ovirt_imageio/_internal/backends/http.py", line 392, in _create_unix_connection
    con.connect()
  File "ovirt_imageio/_internal/backends/http.py", line 627, in connect
    self.sock.connect(self.path)
BlockingIOError: [Errno 11] Resource temporarily unavailable

Increase the backlog to 40. We recommend to do up to 10 image transfers
per host. Doing more will work, but if someone will try to start 60
connections at the same time they will likely experience the same error,
which is good sign that they are overloading the system.

Bug-Url: https://bugzilla.redhat.com/2066113
Signed-off-by: Nir Soffer nsoffer@redhat.com

@nirs nirs added the bug Issue is a bug or fix for a bug label Mar 20, 2022
@nirs nirs requested review from vjuranek and bennyz March 20, 2022 22:01
@nirs nirs force-pushed the http-backlog branch 2 times, most recently from 24d5620 to 5d9d183 Compare March 21, 2022 00:09
bennyz
bennyz previously approved these changes Mar 21, 2022
Both TCP and unix socket based servers inherited the listen backlog from
python socketserver.TCPServer. The default value (5) was never a
problem, but new automated tests using 16 concurrent connections started
to fail randomly recently with:

ERR: Traceback (most recent call last):
  ...
  File "ovirt_imageio/_internal/backends/http.py", line 392, in _create_unix_connection
    con.connect()
  File "ovirt_imageio/_internal/backends/http.py", line 627, in connect
    self.sock.connect(self.path)
BlockingIOError: [Errno 11] Resource temporarily unavailable

Increase the backlog to 40. We recommend to do up to 10 image transfers
per host. Doing more will work, but if someone will try to start 60
connections at the same time they will likely experience the same error,
which is good sign that they are overloading the system.

Bug-Url: https://bugzilla.redhat.com/2066113
Signed-off-by: Nir Soffer <nsoffer@redhat.com>
Test 10 concurrent downloads, each creating 4 connections, reproducing
the bug with the default backlog size.

Bug-Url: https://bugzilla.redhat.com/2066113
Signed-off-by: Nir Soffer <nsoffer@redhat.com>
@vjuranek vjuranek merged commit 8505899 into oVirt:master Mar 21, 2022
@nirs nirs deleted the http-backlog branch March 27, 2022 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is a bug or fix for a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants