Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Apr 2022 09:32:19 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 263604] ifconfig: Low performance with many interface/IP
Message-ID:  <bug-263604-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
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<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu =
1500
        description: OPTIC-BBN
        options=3D600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
        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<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu =
1500
        description: OPTIC-BBN
        options=3D600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
        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.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-263604-227>