Skip to content

Commit

Permalink
🚑 Merge PR #308
Browse files Browse the repository at this point in the history
This change addresses a significant performance regression that was
introduced in v8.1.0 (see #305), sort-term.

It makes the sockets select timeout shorter to reduce the duration of
each tick in the new connection processing loop.

The proper fix is yet to be created per
#308 (comment)
  • Loading branch information
webknjaz committed Jul 27, 2020
2 parents a927551 + 24194f3 commit cedb2c0
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 cedb2c0

Please sign in to comment.