From patchwork Thu Nov 25 21:34:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dumitru Ceara X-Patchwork-Id: 1559898 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=O5Crk02g; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.137; helo=smtp4.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4J0WP13F9rz9s0r for ; Fri, 26 Nov 2021 08:34:45 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 2C21740921; Thu, 25 Nov 2021 21:34:43 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6f6SL-GI1qjx; Thu, 25 Nov 2021 21:34:42 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp4.osuosl.org (Postfix) with ESMTPS id 3296740908; Thu, 25 Nov 2021 21:34:41 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 78FB6C0030; Thu, 25 Nov 2021 21:34:40 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 785D3C000A for ; Thu, 25 Nov 2021 21:34:38 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 66870401D2 for ; Thu, 25 Nov 2021 21:34:38 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp2.osuosl.org (amavisd-new); dkim=pass (1024-bit key) header.d=redhat.com Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ndCmxTzXJU4j for ; Thu, 25 Nov 2021 21:34:37 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by smtp2.osuosl.org (Postfix) with ESMTPS id 66F9C400A4 for ; Thu, 25 Nov 2021 21:34:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1637876076; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/qz7jZoKSTMHkH+MuJ6n9QZT6yc1NPv8uKPoQYWNJbo=; b=O5Crk02g10lJa2qoEFCM3+NprP9dW/kS9jltBgbO2FCd1Lp6RCjzS1P23tIQsg+20xUF17 pVit7qFppR4fN1ofOL9h1sjZDJlDg9dQdsL2c6V+HeQd2ERsuPj0CSE6lWzR3LzHq+Mp0v AFvkvNUMgOoPfOULSoMW3oGgahPLHt0= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-209-p0fGZWvrNrCbywtCAmro3Q-1; Thu, 25 Nov 2021 16:34:17 -0500 X-MC-Unique: p0fGZWvrNrCbywtCAmro3Q-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 046E11006AA0; Thu, 25 Nov 2021 21:34:16 +0000 (UTC) Received: from dceara.remote.csb (unknown [10.39.195.29]) by smtp.corp.redhat.com (Postfix) with ESMTP id 48E9A67842; Thu, 25 Nov 2021 21:34:10 +0000 (UTC) From: Dumitru Ceara To: ovs-dev@openvswitch.org Date: Thu, 25 Nov 2021 22:34:07 +0100 Message-Id: <20211125213405.11165.95718.stgit@dceara.remote.csb> In-Reply-To: <20211125213334.11165.62799.stgit@dceara.remote.csb> References: <20211125213334.11165.62799.stgit@dceara.remote.csb> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dceara@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Cc: blp@ovn.org Subject: [ovs-dev] [RFC PATCH ovn 1/7] tutorial: Add hacky load balancer stress test. 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" Signed-off-by: Dumitru Ceara --- tutorial/automake.mk | 3 +- tutorial/lb-group-stress.sh | 60 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 1 deletion(-) create mode 100755 tutorial/lb-group-stress.sh diff --git a/tutorial/automake.mk b/tutorial/automake.mk index 046962c00..098f7b457 100644 --- a/tutorial/automake.mk +++ b/tutorial/automake.mk @@ -1,6 +1,7 @@ EXTRA_DIST += \ tutorial/ovs-sandbox \ - tutorial/ovn-setup.sh + tutorial/ovn-setup.sh \ + tutorial/lb-group-stress.sh sandbox: all cd $(srcdir)/tutorial && MAKE=$(MAKE) HAVE_OPENSSL=$(HAVE_OPENSSL) \ ./ovs-sandbox -b $(abs_builddir) --ovs-src $(ovs_srcdir) --ovs-build $(ovs_builddir) $(SANDBOXFLAGS) diff --git a/tutorial/lb-group-stress.sh b/tutorial/lb-group-stress.sh new file mode 100755 index 000000000..28fb7f8bc --- /dev/null +++ b/tutorial/lb-group-stress.sh @@ -0,0 +1,60 @@ +nsw=$1 +nlb=$2 + +export OVN_NB_DAEMON=$(ovn-nbctl --detach --pidfile --no-leader-only --log-file=ovn-nbctl.log --db unix:nb1.ovsdb,unix:nb2.ovsdb,unix:nb3.ovsdb) + +sleep 1 + +echo "Adding cluster LB group.." +lb_group_uuid=$(ovn-nbctl create load_balancer_group name="cluster-lbs") + +ovn-nbctl lr-add cluster_rtr +ovn-nbctl ls-add join +ovn-nbctl lrp-add cluster_rtr crtr_join 00:00:00:00:03:01 43.43.43.1/24 +ovn-nbctl lsp-add join join_crtr +ovn-nbctl lsp-set-addresses join_crtr "00:00:00:00:03:01 43.43.43.1" +ovn-nbctl lsp-set-type join_crtr router +ovn-nbctl lsp-set-options join_crtr router-port=crtr_join + +echo "Adding switches/routers.." +for ((i = 0; i < $nsw; i++)); do + echo "Switch/Router $i" + ip2=42.42.$((i/256)).$((i%256)) + ip3=43.43.$((i/256)).$((i%256)) + + ovn-nbctl ls-add ls$i -- add logical_switch ls$i load_balancer_group ${lb_group_uuid} + ovn-nbctl lrp-add cluster_rtr crtr_sw${i} 00:00:00:00:02:01 ${ip2}/16 + ovn-nbctl lsp-add ls$i sw${i}_crtr + ovn-nbctl lsp-set-addresses sw${i}_crtr "00:00:00:00:02:01 ${ip2}" + ovn-nbctl lsp-set-type sw${i}_crtr router + ovn-nbctl lsp-set-options sw${i}_crtr router-port=crtr_sw${i} + ovn-nbctl lsp-add ls$i sw${i}_mgmt + ovn-nbctl lsp-add ls$i sw${i}_mgmt2 + + ovn-nbctl lr-add lr$i -- add logical_router lr$i load_balancer_group ${lb_group_uuid} + ovn-nbctl set logical_router lr$i options:dynamic_neigh_routers=true + ovn-nbctl set logical_router lr$i options:chassis=foo + ovn-nbctl lrp-add lr$i lr${i}_join 00:00:00:00:04:01 ${ip3}/16 + ovn-nbctl lsp-add join join_lr${i} + ovn-nbctl lsp-set-addresses join_lr${i} "00:00:00:00:04:01 ${ip3}" + ovn-nbctl lsp-set-type join_lr${i} router + ovn-nbctl lsp-set-options join_lr${i} router-port=lr${i}_join +done + +echo "Adding load balancers.." +for ((j = 0; j < $nlb; j++)); do + echo "Adding LB $j.." + ip1="42.$((j/255)).$((j%255)).1" + ip2="42.$((j/255)).$((j%255)).2" + ovn-nbctl --id=@id create load_balancer name=lb$j protocol=tcp vips:"\"${ip1}:8080\""="\"${ip2}:8081\"" \ + -- add load_balancer_group ${lb_group_uuid} load_balancer @id +done + +ovn-nbctl --wait=sb sync + +echo "DONE with the base setup, adding one more load balancer" +echo "Adding LB $j.." +ip1="42.$((j/255)).$((j%255)).1" +ip2="42.$((j/255)).$((j%255)).2" +ovn-nbctl --id=@id create load_balancer name=lb$j protocol=tcp vips:"\"${ip1}:8080\""="\"${ip2}:8081\"" \ + -- add load_balancer_group ${lb_group_uuid} load_balancer @id