Skip to content

Commit 2d78d5d

Browse files
authored
Merge pull request #4694 from barnabasdomozi/increase_backlog_size
Increase TCP backlog size
2 parents af3e4a6 + 2b88578 commit 2d78d5d

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

web/server/codechecker_server/server.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -623,6 +623,17 @@ class CCSimpleHttpServer(HTTPServer):
623623
daemon_threads = False
624624
address_family = socket.AF_INET # IPv4
625625

626+
# The size of the request queue. If it takes a long time to process
627+
# a single request, any requests that arrive while the server is busy are
628+
# placed into a queue, up to request_queue_size requests [1].
629+
# The default value of 5 is not sufficient for production grade servers,
630+
# so we increase it to 511.
631+
# Apache [2] and Nginx webservers use 511 as the default backlog size
632+
# for historical and practical reasons.
633+
# [1] https://docs.python.org/3/library/socketserver.html
634+
# [2] https://httpd.apache.org/docs/2.4/mod/mpm_common.html#listenbacklog
635+
request_queue_size = 511
636+
626637
def __init__(self,
627638
server_address,
628639
RequestHandlerClass,

0 commit comments

Comments
 (0)