Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 30 Jul 2023 23:04:41 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 272818] hv_kvp_daemon high CPU usage on Internet router
Message-ID:  <bug-272818-227-P6KmBg8hQl@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-272818-227@https.bugs.freebsd.org/bugzilla/>
References:  <bug-272818-227@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D272818

Greg Becker <greg@codeconcepts.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |greg@codeconcepts.com

--- Comment #1 from Greg Becker <greg@codeconcepts.com> ---
Presuming "hn1" is an interface (?), there's only one "default" route, and =
the
default route is always printed within the first few lines, then having awk
stop on the first match should kill the netstat command before it generates
very much output, which I would think would greatly reduce the CPU overhead.

But I'd have to see the output of your 'netstat -rn' command to be sure.  W=
orst
case, netstat does a whole lot of CPU intensive work before it starts emitt=
ing
routes, in which case curbing the output may not help much.

I didn't see any sysctl to print the default route, which would have been n=
ice
and probably result in much less overhead than launching into netstat.  Per=
haps
there is some other light-weight way in which to get the default route?

Off the top of my head, something like the following might improve things:

netstat -rn | awk -v interface=3Dhn1 '$1 =3D=3D "default" && $4 =3D=3D inte=
rface {print
$2; rc=3D1; exit; } END{exit !rc}'

--=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-272818-227-P6KmBg8hQl>