ports/155072: net-mgmt/net-snmp: ssRawCpu* incorrectly calculated

Helmut Schneider jumper99 at gmx.de
Sat Feb 26 20:00:19 UTC 2011


>Number:         155072
>Category:       ports
>Synopsis:       net-mgmt/net-snmp: ssRawCpu* incorrectly calculated
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Feb 26 20:00:18 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Helmut Schneider
>Release:        8.1-RELEASE-p2
>Organization:
>Environment:
>Description:
ssRawCpu* is a value that shows the usage of e.g. system, user, nice and idle. Every integer stands for 1/100th of CPU usage. So e.g. ssCpuIdle should increase to 60 seconds * 100 = 6000 per minute per CPU. Analogously ssCpuRawUser and ssCpuSystem should increase to the same amount at fully load. You can check this e.g. with any Linux distribution.

net-snmp 5.5 (tested) on FreeBSD 8.1 i386 and amd64 (tested) increases to a value of ~ 6000*3/4 which is ~33% too high:

[helmut at BSDHelmut832 ~]$ snmpwalk -v2c -cpublic localhost .1.3.6.1.4.1.2021.11; sleep 60; snmpwalk -v2c -cpublic localhost .1.3.6.1.4.1.2021.11
[...]
UCD-SNMP-MIB::ssCpuUser.0 = INTEGER: 99
UCD-SNMP-MIB::ssCpuSystem.0 = INTEGER: 0
UCD-SNMP-MIB::ssCpuIdle.0 = INTEGER: 0
UCD-SNMP-MIB::ssCpuRawUser.0 = Counter32: 1158132
UCD-SNMP-MIB::ssCpuRawNice.0 = Counter32: 19759
UCD-SNMP-MIB::ssCpuRawSystem.0 = Counter32: 145467
UCD-SNMP-MIB::ssCpuRawIdle.0 = Counter32: 30152171
UCD-SNMP-MIB::ssCpuRawWait.0 = Counter32: 0
UCD-SNMP-MIB::ssCpuRawKernel.0 = Counter32: 144653
UCD-SNMP-MIB::ssCpuRawInterrupt.0 = Counter32: 814
[...]
UCD-SNMP-MIB::ssCpuRawSoftIRQ.0 = Counter32: 0
[...]
#### second run:
UCD-SNMP-MIB::ssCpuUser.0 = INTEGER: 99
UCD-SNMP-MIB::ssCpuSystem.0 = INTEGER: 0
UCD-SNMP-MIB::ssCpuIdle.0 = INTEGER: 0
UCD-SNMP-MIB::ssCpuRawUser.0 = Counter32: 1166104
UCD-SNMP-MIB::ssCpuRawNice.0 = Counter32: 19759
UCD-SNMP-MIB::ssCpuRawSystem.0 = Counter32: 145499
UCD-SNMP-MIB::ssCpuRawIdle.0 = Counter32: 30152171
UCD-SNMP-MIB::ssCpuRawWait.0 = Counter32: 0
UCD-SNMP-MIB::ssCpuRawKernel.0 = Counter32: 144684
UCD-SNMP-MIB::ssCpuRawInterrupt.0 = Counter32: 815
[...]
UCD-SNMP-MIB::ssCpuRawSoftIRQ.0 = Counter32: 0
[...]
[helmut at BSDHelmut832 ~]$

1st: UCD-SNMP-MIB::ssCpuRawIdle.0 = Counter32: 30152171
2nd: UCD-SNMP-MIB::ssCpuRawIdle.0 = Counter32: 30152171

1st: UCD-SNMP-MIB::ssCpuRawUser.0 = Counter32: 1158132
2nd: UCD-SNMP-MIB::ssCpuRawUser.0 = Counter32: 1166104

1st: UCD-SNMP-MIB::ssCpuRawSystem.0 = Counter32: 145467
2nd: UCD-SNMP-MIB::ssCpuRawSystem.0 = Counter32: 145499

1st: UCD-SNMP-MIB::ssCpuRawNice.0 = Counter32: 19759
2nd: UCD-SNMP-MIB::ssCpuRawNice.0 = Counter32: 19759

1158132 - 1166104 = -7972

helmut at ubuntu:~$ snmpwalk -v2c -cpublic localhost .1.3.6.1.4.1.2021.11; sleep 60; snmpwalk -v2c -cpublic localhost .1.3.6.1.4.1.2021.11
[...]
UCD-SNMP-MIB::ssCpuUser.0 = INTEGER: 99
UCD-SNMP-MIB::ssCpuSystem.0 = INTEGER: 0
UCD-SNMP-MIB::ssCpuIdle.0 = INTEGER: 0
UCD-SNMP-MIB::ssCpuRawUser.0 = Counter32: 22881
UCD-SNMP-MIB::ssCpuRawNice.0 = Counter32: 0
UCD-SNMP-MIB::ssCpuRawSystem.0 = Counter32: 9750
UCD-SNMP-MIB::ssCpuRawIdle.0 = Counter32: 7555837
UCD-SNMP-MIB::ssCpuRawWait.0 = Counter32: 17298
UCD-SNMP-MIB::ssCpuRawKernel.0 = Counter32: 0
UCD-SNMP-MIB::ssCpuRawInterrupt.0 = Counter32: 65
[...]
UCD-SNMP-MIB::ssCpuRawSoftIRQ.0 = Counter32: 236
##### Second run
UCD-SNMP-MIB::ssCpuUser.0 = INTEGER: 99
UCD-SNMP-MIB::ssCpuSystem.0 = INTEGER: 0
UCD-SNMP-MIB::ssCpuIdle.0 = INTEGER: 0
UCD-SNMP-MIB::ssCpuRawUser.0 = Counter32: 28874
UCD-SNMP-MIB::ssCpuRawNice.0 = Counter32: 0
UCD-SNMP-MIB::ssCpuRawSystem.0 = Counter32: 9753
UCD-SNMP-MIB::ssCpuRawIdle.0 = Counter32: 7555837
UCD-SNMP-MIB::ssCpuRawWait.0 = Counter32: 17298
UCD-SNMP-MIB::ssCpuRawKernel.0 = Counter32: 0
UCD-SNMP-MIB::ssCpuRawInterrupt.0 = Counter32: 65
UCD-SNMP-MIB::ssCpuRawSoftIRQ.0 = Counter32: 236
[...]
helmut at ubuntu:~$

22881 - 28874 = -5993

That results in the following graphs:

1) Single CPU Ubuntu 10.04: http://www.charlieroot.de/downloads/Ubuntu-10.04-x86-single-core.jpg
2) Single CPU FreeBSD 8.1 x86: http://www.charlieroot.de/downloads/FreeBSD-x86-single-core.jpg
3) Quad-Core CPU FreeBSD 8.1 amd64: http://www.charlieroot.de/downloads/FreeBSD-amd64-quad-core.jpg

None of those CPUs supports HT.

The load was created with:

perl -e 'while (--$ARGV[0] and fork) {}; while () {}' ${CPU_COUNT}
>How-To-Repeat:
Install net-snmp, create load, query snmpd.
>Fix:


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list