[FIX] service.server: bump up socket timeout to 2s
Rev.8245c1d1d8
introduced a timeout to avoid lockup situations with wkhtmltopdf's requests on servers with low numbers of free HTTP workers. The initial timeout of 500ms was chosen based on average network latency, but turned out to cause spurious disconnections on congested networks combined with slow links. Bumping up the timeout to 2s seems to be a better sweet spot, causing less spurious disconnections while still recovering reasonably fast from the wkhtmltopdf lockup situation. See also these discussions: -8245c1d1d8 (commitcomment-22904347)
- PR #12356 - Issue #2114 Closes #17998
This commit is contained in:
parent
a38544f63f
commit
ecc093033d
|
@ -777,7 +777,7 @@ class WorkerHTTP(Worker):
|
|||
""" HTTP Request workers """
|
||||
def process_request(self, client, addr):
|
||||
client.setblocking(1)
|
||||
client.settimeout(0.5)
|
||||
client.settimeout(2)
|
||||
client.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
|
||||
# Prevent fd inherientence close_on_exec
|
||||
flags = fcntl.fcntl(client, fcntl.F_GETFD) | fcntl.FD_CLOEXEC
|
||||
|
|
Loading…
Reference in New Issue