[issue31610] Use select.poll instead of select.select in SocketServer.BaseServer.serve_forever

Беатрис Бонева report at bugs.python.org
Wed Sep 27 07:24:45 EDT 2017


New submission from Беатрис Бонева <beatrisvboneva at gmail.com>:

The select function does not work for file descriptors with number >= 1024. It has FD_SETSIZE limit (see https://stackoverflow.com/questions/7976388/increasing-limit-of-fd-setsize-and-select#7977082).
So, serve_forever won't work if more than 1024 file descriptors are opened in the process (ValueError: filedescriptor out of range in select() is raised).
Moreover, the select function is considered inefficient, hard to scale and old-fashioned nowadays. Refer to https://stackoverflow.com/questions/970979/what-are-the-differences-between-poll-and-select#3951845.
Better alternative will be to use poll or epoll even.

----------
components: Library (Lib)
messages: 303127
nosy: Беатрис Бонева
priority: normal
severity: normal
status: open
title: Use select.poll instead of select.select in SocketServer.BaseServer.serve_forever
type: performance

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31610>
_______________________________________


More information about the Python-bugs-list mailing list