On Thu, Dec 12, 2019 at 8:46 AM Antoine Pitrou <solip...@pitrou.net> wrote: > > 1) Handling a large number of concurrent clients on a continuously running > > web server that receives a significant amount of traffic. > > Not sure how that works? Each client has an accepted socket, which is > bound to a local port number, and there are 65536 TCP port numbers > available. Unless you're using 15+ coroutines per client, you probably > won't reach 1M coroutines that way.
Each client has a socket, yes, but they all use the same local port number. Distinct sockets are identified by the tuple (TCP, LocalAddr, LocalPort, RemoteAddr, RemotePort) and can quite happily duplicate on any part of that as long as they can be distinguished by some other part. There will be other limits, though. On Linux (and probably most Unix-like systems), every socket requires a file descriptor, and you're limited to a few hundred thousand of those, I think. On Windows, sockets aren't the same things as files, so I don't know what the limit actually is, but there'll be one somewhere. ChrisA _______________________________________________ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/3CWDIR5WPMW67GUMH4743SMELDKRQCRC/ Code of Conduct: http://python.org/psf/codeofconduct/