Skip to content

Commit

Permalink
Reduce select timeout from 0.1 to 0.01
Browse files Browse the repository at this point in the history
Update #305
  • Loading branch information
mar10 committed Jul 27, 2020
1 parent b228a49 commit 24194f3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cheroot/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,12 @@ def get_conn(self, server_socket):
try:
for fno in socket_dict:
self._selector.register(fno, selectors.EVENT_READ)
# The timeout value impacts performance and should be carefully
# chosen. Ref:
# github.com/cherrypy/cheroot/issues/305#issuecomment-663985165
rlist = [
key.fd for key, _event
in self._selector.select(timeout=0.1)
in self._selector.select(timeout=0.01)
]
except OSError:
# Mark any connection which no longer appears valid.
Expand Down

0 comments on commit 24194f3

Please sign in to comment.