From nobody Wed Apr 27 09:32:19 2022 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 308CE1AA9FEE for ; Wed, 27 Apr 2022 09:32:20 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KpD6q6YxXz3Qsh for ; Wed, 27 Apr 2022 09:32:19 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C2197211FC for ; Wed, 27 Apr 2022 09:32:19 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 23R9WJjU034884 for ; Wed, 27 Apr 2022 09:32:19 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 23R9WJkB034882 for bugs@FreeBSD.org; Wed, 27 Apr 2022 09:32:19 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 263604] ifconfig: Low performance with many interface/IP Date: Wed, 27 Apr 2022 09:32:19 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: Unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: dl@CyberPunk.ru X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651051939; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xwKArZRsQ21msMOvA/V1XqPpLPtEp4+lRw6tz4vdxDs=; b=baahkb15hYBBG1hzKguqjJLssczmUnTtDSkYNAajwDBf8f7U4g46mcdIF20rYqkVdblXAG 6ynaoezMOiZU9LV03VIFmYri57GuRbloeQQ0mt2NK8GBETFwhCu0L1vf4skbTh6m81Y+Ap W65GldWVdC8vdVorvbK7XmDabvZv7sd9hm2UijJd7cG/yJfjJMi/bhD+nVvhvX9JG7vrVJ IXAgy74Hk9JyCrlyPWePFH15q3o0/Y6phSzMnQbocRxHXUiLAGwuq7kqdVWve0Ztj0D7Eo N/sa+THy1yizwAJUf2umiax1vZ+exkupJXIE1UsyiH+TsELrpQDj4LXqxgSbvA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1651051939; a=rsa-sha256; cv=none; b=EGmYhUSQDT186V+AKvePn9zCXY21Z/EW2H6ZhMoKKmOzcKjiZCpVM5q9mA/yHIQZqouVPz pJ7DydOs9nGfnO0dp50BkTQBhCMIRC4u+xnOaXiIg4RxkToZ9gs5BcwJKxBrpBR8Le63G5 Pzu+GrB3uc70WZKjXUPESsta0kihowP+wUs0nneDBKnxcsSQt0AVPgiI6guQetdft7HQgY fI8BUEsOGKqx9UdxJU9py4n8gf9EBdse3nhAbh+DqKXq3aOzEKLM6p23TbsmNqky9udpQ9 v3PONrr7yk6Qp3YVfcSLIIUkMfQirUNcxrVuyYQHdMYTKieHCga2v/pO1Nti1g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D263604 Bug ID: 263604 Summary: ifconfig: Low performance with many interface/IP Product: Base System Version: Unspecified Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: bin Assignee: bugs@FreeBSD.org Reporter: dl@CyberPunk.ru Created attachment 233531 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D233531&action= =3Dedit ifconfig: disabled sort-grouping patch Colleagues, Good Day. We have several service routers FreeBSD with thousands of interfaces and IP-addresses. With more than a thousand interfaces/IP, the command ifconfig execution speed degrades. The problem occurred when making the inet/inet6 grouping on each interface.= The change was in: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D197270 https://svnweb.freebsd.org/base?view=3Drevision&revision=3D278080 https://cgit.freebsd.org/src/commit/sbin/ifconfig/ifconfig.c?id=3D35c73e51c= c801af670588c3fc7e72dc612d5a746 If you remove the call to the sort-grouping function sortifaddrs() in main(= ), then the degradation of performance disappears. See attached patch ifconfig_sort_disabled.patch . Judging by the document https://wiki.freebsd.org/BootTime , the development team is struggling to reduce the system boot time. I assure you, disabling grouping in ifconfig significantly reduces the system boot time with thousa= nds of interfaces. I hope the development team will be interested in disabling grouping in "some cases" to speed up the download. It may be possible to implement disabling grouping by some ifconfig option used at the time of loading in scripts rc.d. Thanks. Peaceful sky. Example. Router have 1407 IP-addresses on 3597 interfaces. ifconfig -a | grep inet | wc -l ; ifconfig -l | wc -w 1407 3597 Execute original ifconfig. Have 1.481 seconds user time. time ifconfig vlan430 vlan430: flags=3D8843 metric 0 mtu = 1500 description: OPTIC-BBN options=3D600003 ether a0:36:9f:11:d6:30 inet 10.250.234.96 netmask 0xffffff00 broadcast 10.250.234.255=20 groups: vlan CoNet=20 vlan: 430 vlanpcp: 0 parent interface: lagg0 media: Ethernet autoselect status: active 1.481u 0.007s 0:01.91 77.4% 144+216k 0+0io 0pf+0w Execute after patch ifconfig. Have 0.000 seconds user time. time ifconfig vlan430 vlan430: flags=3D8843 metric 0 mtu = 1500 description: OPTIC-BBN options=3D600003 ether a0:36:9f:11:d6:30 inet 10.250.234.96 netmask 0xffffff00 broadcast 10.250.234.255=20 groups: vlan CoNet=20 vlan: 430 vlanpcp: 0 parent interface: lagg0 media: Ethernet autoselect status: active 0.000u 0.010s 0:00.01 100.0% 224+336k 0+0io 0pf+0w --=20 You are receiving this mail because: You are the assignee for the bug.=