From patchwork Fri May 31 19:40:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Haley X-Patchwork-Id: 1942294 X-Patchwork-Delegate: i.maximets@samsung.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=d4lcaWJ6; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::133; helo=smtp2.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VrYPL3Fnyz20Pr for ; Sat, 1 Jun 2024 05:40:20 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 6EE41405D5; Fri, 31 May 2024 19:40:18 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id D1F9-km9zm2O; Fri, 31 May 2024 19:40:15 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.9.56; helo=lists.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org CB8CF40141 Authentication-Results: smtp2.osuosl.org; dkim=fail reason="signature verification failed" (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=d4lcaWJ6 Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp2.osuosl.org (Postfix) with ESMTPS id CB8CF40141; Fri, 31 May 2024 19:40:15 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id ACC6CC0072; Fri, 31 May 2024 19:40:15 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 7226FC0037 for ; Fri, 31 May 2024 19:40:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 538F861191 for ; Fri, 31 May 2024 19:40:14 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id VU7SrDzVjU0b for ; Fri, 31 May 2024 19:40:13 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2607:f8b0:4864:20::f2c; helo=mail-qv1-xf2c.google.com; envelope-from=haleyb.dev@gmail.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp3.osuosl.org 56BFE606CA Authentication-Results: smtp3.osuosl.org; dmarc=pass (p=none dis=none) header.from=gmail.com DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 56BFE606CA Authentication-Results: smtp3.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=d4lcaWJ6 Received: from mail-qv1-xf2c.google.com (mail-qv1-xf2c.google.com [IPv6:2607:f8b0:4864:20::f2c]) by smtp3.osuosl.org (Postfix) with ESMTPS id 56BFE606CA for ; Fri, 31 May 2024 19:40:13 +0000 (UTC) Received: by mail-qv1-xf2c.google.com with SMTP id 6a1803df08f44-6ad7a2f8715so22761356d6.1 for ; Fri, 31 May 2024 12:40:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717184412; x=1717789212; darn=openvswitch.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=FPNaFu7skOPT/zWTyxA1aTzOVzOy3c+rh61rs5rerEM=; b=d4lcaWJ6Clsxx1RyIR2bCyzsUpQm2+dKfg5CGXNNjYHsy2nim/oOr2X2EIpjQlHMGG 8oPF7EcXNZ/sbujFkA1Hh7guWYHdi9wJ/+kdJOFvSSHygMgleTOqVHzgNmIymOuTxBCF l8XiynRbvd2T6CxFS4H0/WRPWWTNEIW0gCO5/aRbVwa8FxZYOw6oedjLDQW6w4wllv+p W82exj/WFqhM8Cj4ZtztrRueJs5Uw6Tp1iiPoZiPMl2OO2oupV+q8q3Gx0fin4jAxTS5 e38A4f05eETdKW8tz7v8jmi6m8QIJxo/9XiLtRIbb/LgGM6tnH8n4fwwCECubayHjpR7 aOtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717184412; x=1717789212; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=FPNaFu7skOPT/zWTyxA1aTzOVzOy3c+rh61rs5rerEM=; b=utJeB4VocIklt00HQek5lmhmnMyG4Ss12/gxA3YDtASZTLT7RF2C+gd7SXrWVcG4Ah 3xH+gIQqHR5R3Piw7SJRl21hUvt1Kh9gVOFYBHvC+8hCgf/bMl6bbWaoCPpsvSXrOsP+ JUMis3PzJ8Exrm3LazVGaTUdsuBxTcdyeRDdzv1jqwR3EvS1tPRfKwNhzWmeGK/0s/IY G44LsuYEP5ue6KWNXFICd+z5B0ZFo8ZIFdGVTo0X5B5coPcpiFfO8lqhVYETiUJVZO0P G99m4egYuBbEa5qiggzCwiorS4+6pwzlFslNELLpKheYCZRrxPGGpOHdUj6hg3PwRafM c/8g== X-Gm-Message-State: AOJu0YyOqFiW7fbhq9gY3LbOIaTDlrBwJD+wxDXhgGc11N/4pwqlMOdX tltX8c/3pptl/vM7vXuzl2I18XwhLe6oH1pYtLxlbPA18MCwadZ7W+2i2g== X-Google-Smtp-Source: AGHT+IFQ8U3x+XJGw7eDM95Uux9805hyoW35gBCHjnIvrfbHy1GRWeRI/4bZ1vNHeKkYobCxT6o3+A== X-Received: by 2002:ad4:5c42:0:b0:6a1:6081:6879 with SMTP id 6a1803df08f44-6ae0ec672dfmr134366176d6.17.1717184411743; Fri, 31 May 2024 12:40:11 -0700 (PDT) Received: from localhost.localdomain ([2601:18f:107f:8be0::1007]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6ae4b42b392sm8973926d6.133.2024.05.31.12.40.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 12:40:11 -0700 (PDT) From: Brian Haley To: dev@openvswitch.org Date: Fri, 31 May 2024 15:40:08 -0400 Message-Id: <20240531194008.3171150-1-haleyb.dev@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [ovs-dev] [PATCH] socket: Increase listen backlog to 128 everywhere. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" An earlier patch [1] increased the size of the listen backlog to 64. While that was a huge improvement over 10, further testing in large deployments showed 128 was even better. Looking at 'ss -lmt' output over more than one week for port 6641, captured across three different controllers, the average was: listen(s, 10) : 1213 drops/day listen(s, 64) : 791 drops/day listen(s, 128): 657 drops/day Looking at 'netstat -s | egrep -i 'listen|drop|SYN_RECV'' output over one week for port 6641, again captured across three different controllers, the average was: listen(s, 10) : 741 drops/day listen(s, 64) : 200 drops/day listen(s, 128): 22 drops/day While having this value configurable would be the best solution, changing to 128 is a quick fix that should be good for all deployments. A link to the original discussion is at [2]. [1] https://github.com/openvswitch/ovs/commit/2b7efee031c3a2205ad2ee999275893edd083c1c [2] https://github.com/openvswitch/ovs/commit/2b7efee031c3a2205ad2ee999275893edd083c1c Signed-off-by: Brian Haley --- lib/socket-util.c | 2 +- python/ovs/stream.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/socket-util.c b/lib/socket-util.c index c569b7d16..552310266 100644 --- a/lib/socket-util.c +++ b/lib/socket-util.c @@ -769,7 +769,7 @@ inet_open_passive(int style, const char *target, int default_port, } /* Listen. */ - if (style == SOCK_STREAM && listen(fd, 64) < 0) { + if (style == SOCK_STREAM && listen(fd, 128) < 0) { error = sock_errno(); VLOG_ERR("%s: listen: %s", target, sock_strerror(error)); goto error; diff --git a/python/ovs/stream.py b/python/ovs/stream.py index dbb6b2e1f..874fe0bd5 100644 --- a/python/ovs/stream.py +++ b/python/ovs/stream.py @@ -620,7 +620,7 @@ class PassiveStream(object): raise Exception('Unknown connection string') try: - sock.listen(64) + sock.listen(128) except socket.error as e: vlog.err("%s: listen: %s" % (name, os.strerror(e.error))) sock.close()