From patchwork Tue Nov 10 12:06:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Renat Nurgaliyev X-Patchwork-Id: 1397613 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: 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=20161025 header.b=tDARTAvT; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CVmn73cJSz9s1l for ; Tue, 10 Nov 2020 23:06:51 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id CD00686FA2; Tue, 10 Nov 2020 12:06:49 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ndK+EtkkgIM9; Tue, 10 Nov 2020 12:06:49 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by hemlock.osuosl.org (Postfix) with ESMTP id 2868C81E5D; Tue, 10 Nov 2020 12:06:49 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 08180C0889; Tue, 10 Nov 2020 12:06:49 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id B9370C016F for ; Tue, 10 Nov 2020 12:06:47 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 8C71A227F8 for ; Tue, 10 Nov 2020 12:06:47 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6fvQrhoffdiL for ; Tue, 10 Nov 2020 12:06:46 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by silver.osuosl.org (Postfix) with ESMTPS id E52112047B for ; Tue, 10 Nov 2020 12:06:45 +0000 (UTC) Received: by mail-wm1-f66.google.com with SMTP id 10so2763448wml.2 for ; Tue, 10 Nov 2020 04:06:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:cc:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding:content-language; bh=bhrng8kP0TBejYFQLvmijeorSriEHmnou/XDtGPjhUE=; b=tDARTAvTPIb2Iy6YmVimnHvfLh5osTFMkxvXH3TCd8WycP5m0dTiKWictLJHZuirQg cVzkM+YtCrZSwW0vAuGzeEAmgo7AnOID2MEL/7wfRdhtvqJYSyVcvv2/496v2dWq4RK7 wlud+qncwqoS9WLZKeH6bvRCD1jNYk8z6BHSUG5H05/CtguJVlUyKTReWAdx/NTBNf5j jueumV+YS0xN7xDRpLcWn5MbgsRvvbpTdr9KcQJnQStEV69mzL4jVwgeyb4ME88BAjuM 3wt0IFOjhByf2rTKjzdVA3vPcUWMe+A1hOuaJPT7UFe8+MLGJCJbia6rO9fXGxBMPpFH XlXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding:content-language; bh=bhrng8kP0TBejYFQLvmijeorSriEHmnou/XDtGPjhUE=; b=lAPxdSeSHE17qJO/BqMD9BhtZ/N6aOOa+3K045oAgOpzWZl+2YThnJurtOOj7nKThf q3l0WvzdN1rjDE8x1PWPewyPcXRjOGWZWZ0/1P8gqtfUU3wdcUu/9kGp286exebpn8RI 8bhkKpb1HrvqiM6I8wUmgICcAMDXEcRUu6hVmdocx640PGYDtCVqY92bpdadr8Jwk9ul eaRQE3rO+Fh1MMmHyJiHU3hhzsAWCW0M17J6oc5KpgsGEYMdC4DwaZ1K6fgyYRWrC2Iy 9+zE3FwknoACJOxqabLFTWQBPULO/8LFJh3PYX4SAPlF8tRWGfX/733E5LUg6jYEHBqV RJTw== X-Gm-Message-State: AOAM5326/4HBOoJwbyy/GOV/+5lwjW8cquKuajVjsyL3iIGpBLJFnKcb cHMyNKqhLgc3SsP7Go1fRtYfXyr0CIXvsA== X-Google-Smtp-Source: ABdhPJyd9wqFvO4PljoY2hCkJq3n9DhRiTUCEB+ze9KfFq9LfMtYvyT6g2phZ4VLH5r/Ttr3jzBPUQ== X-Received: by 2002:a1c:5a06:: with SMTP id o6mr4525017wmb.181.1605010004450; Tue, 10 Nov 2020 04:06:44 -0800 (PST) Received: from Renats-MacBook-Air.local (55d4b8cc.access.ecotel.net. [85.212.184.204]) by smtp.gmail.com with ESMTPSA id r8sm6076273wrq.14.2020.11.10.04.06.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 10 Nov 2020 04:06:43 -0800 (PST) To: ovs-dev@openvswitch.org From: Renat Nurgaliyev Message-ID: <8e015260-86be-f5b2-383c-a863574f7ad6@gmail.com> Date: Tue, 10 Nov 2020 13:06:42 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.4.2 MIME-Version: 1.0 Content-Language: en-GB Subject: [ovs-dev] [PATCH ovn v2] northd: Don't poll ovsdb before the connection is fully established 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" Set initial SB and NB DBs probe interval to 0 to avoid connection flapping. Before configured in northd_probe_interval value is actually applied to southbound and northbound database connections, both connections must be fully established, otherwise ovnnb_db_run() will return without retrieving configuration data from northbound DB. In cases when southbound database is big enough, default interval of 5 seconds will kill and retry the connection before it is fully established, no matter what is set in northd_probe_interval. Client reconnect will cause even more load to ovsdb-server and cause cascade effect, so northd can never stabilise. We have more than 2000 ports in our lab, and northd could not start before this patch, holding at 100% CPU utilisation both itself and ovsdb-server. After connections are established, any value in northd_probe_interval, or default DEFAULT_PROBE_INTERVAL_MSEC is applied correctly. Signed-off-by: Renat Nurgaliyev --- v2: - Resubmitting patch because git am failed last time --- northd/ovn-northd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) dev mailing list dev@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev diff --git a/northd/ovn-northd.c b/northd/ovn-northd.c index 684c2bd47..073c6a0f3 100644 --- a/northd/ovn-northd.c +++ b/northd/ovn-northd.c @@ -100,7 +100,7 @@ static struct eth_addr svc_monitor_mac_ea; /* Default probe interval for NB and SB DB connections. */ #define DEFAULT_PROBE_INTERVAL_MSEC 5000 -static int northd_probe_interval_nb = DEFAULT_PROBE_INTERVAL_MSEC; -static int northd_probe_interval_sb = DEFAULT_PROBE_INTERVAL_MSEC; +static int northd_probe_interval_nb = 0; +static int northd_probe_interval_sb = 0; #define MAX_OVN_TAGS 4096 -- 2.29.2 _______________________________________________