Skip to content

asyncio accepting connection limit #77992

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

Closed
lisaliguoyahoocom mannequin opened this issue Jun 8, 2018 · 5 comments
Closed

asyncio accepting connection limit #77992

lisaliguoyahoocom mannequin opened this issue Jun 8, 2018 · 5 comments
Labels
topic-asyncio type-bug An unexpected behavior, bug, or error

Comments

@lisaliguoyahoocom
Copy link
Mannequin

lisaliguoyahoocom mannequin commented Jun 8, 2018

BPO 33811
Nosy @asvetlov, @1st1, @lisaliguo@yahoo.com

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = None
created_at = <Date 2018-06-08.22:53:47.155>
labels = ['type-bug', '3.8', 'expert-asyncio']
title = 'asyncio accepting connection limit'
updated_at = <Date 2018-06-10.00:11:37.309>
user = 'https://github.com/lisaliguoyahoocom'

bugs.python.org fields:

activity = <Date 2018-06-10.00:11:37.309>
actor = 'lguo'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['asyncio']
creation = <Date 2018-06-08.22:53:47.155>
creator = 'lguo'
dependencies = []
files = []
hgrepos = []
issue_num = 33811
keywords = []
message_count = 3.0
messages = ['319116', '319119', '319189']
nosy_count = 3.0
nosy_names = ['asvetlov', 'yselivanov', 'lguo']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue33811'
versions = ['Python 3.8']

@lisaliguoyahoocom
Copy link
Mannequin Author

lisaliguoyahoocom mannequin commented Jun 8, 2018

https://bugs.python.org/issue27906 describes a situation where accept rate of connection is too slow for use cases where spikes of incoming connection warrants fast accept. The fix for that was to accept socket connection in a tight loop until it reaches "backlog" connections.

This doesn't work very well in a web server scenario where we have many processes listening on the same socket. Each process should not accept up to "backlog" connections, for better load balancing among processes. It would be ideal if this is a separate argument for the server configuration so that the application can decide up to how many connections it is willing to accept in the loop, independent of the backlog parameter for listen() system call.

Let me know if this makes sense.

Lisa

@lisaliguoyahoocom lisaliguoyahoocom mannequin added 3.8 (EOL) end of life type-bug An unexpected behavior, bug, or error labels Jun 8, 2018
@1st1
Copy link
Member

1st1 commented Jun 8, 2018

In principle this sounds good, but I'm not sure how the API and implementation would look like. Maybe you can share a bit more details?

@lisaliguoyahoocom
Copy link
Mannequin Author

lisaliguoyahoocom mannequin commented Jun 10, 2018

One rough idea would be like this: https://github.com/python/cpython/compare/master...lguo2020:fix-issue-33811?expand=1. Another option is to associate it with the loop:

loop.set_max_accept(2)

and then later

self._loop._start_serving(....., max_accept=self._loop._max_accept)

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
@ezio-melotti ezio-melotti moved this to Todo in asyncio Jul 17, 2022
@kumaraditya303 kumaraditya303 removed the 3.8 (EOL) end of life label Oct 9, 2022
@kumaraditya303
Copy link
Contributor

This doesn't look much useful as usually reverse proxy servers are used for load balancing ex nginx.

@gvanrossum
Copy link
Member

Yeah, let's close this for lack of activity.

@gvanrossum gvanrossum closed this as not planned Won't fix, can't repro, duplicate, stale Jan 10, 2023
@github-project-automation github-project-automation bot moved this from Todo to Done in asyncio Jan 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic-asyncio type-bug An unexpected behavior, bug, or error
Projects
Status: Done
Development

No branches or pull requests

3 participants