Todo #15780
openSpeed up MBUF Usage command in system information widget
0%
Description
PR: https://github.com/pfsense/pfsense/pull/4703
Possibly linked to: https://redmine.pfsense.org/issues/6614
The MBUF usage command is responsible for a huge amount of cpu utilization and time needed to execute getstats.php (relative to other commands needed for system information widget).
Tested on a throttled virtualized system, v2.7.2 (idle was close to 100% without web console used):
Original system information widget (getstats.php)
CPU idle: 45% (avg of 15 runs)
time to execute: min=48ms, max=128ms
Original system information widget WITHOUT MBUF
CPU idle: 77% (avg of 15 runs)
time to execute: min=17ms, max=19ms
System information widget after changes in PR:
CPU idle: 75% (avg of 15 runs)
time to execute: min=20ms, max=22ms
Instead of using:
/usr/bin/netstat -mb | /usr/bin/grep "mbuf clusters in use" | /usr/bin/awk '{ print $1 }'
I tried using:
/usr/bin/vmstat -z | /usr/bin/grep mbuf_cluster | /usr/bin/grep -v debugnet | /usr/bin/awk '{print $3,$4,$5}'
I also tried to simplify the logic by only using 1 function, and only returning 1 value. I think the code looks cleaner now.
I am not sure if this works on all architectures.
Updated by Jim Pingle about 1 month ago
- Target version set to 2.8.0
- Plus Target Version set to 25.01
See my comments on the PR for an alternate method since the one used isn't viable as-is.