As stated in the title, when I run echo ::memstat | mdb -k
on certain machines, it is very slow. My munin graphs show a vastly increased CPU load when I run this regularly. I intend to use ::memstat
as input for munin graphs, so it needs to be run frequently.
While the process is running, I see this in the prstat
output:
PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/NLWP
6865 root 14M 12M cpu2 0 0 0:00:26 23% mdb/1
6868 root 14M 12M cpu1 0 0 0:00:26 23% mdb/1
As you can see, it has already been running for 26 seconds. Monitoring prstat
shows an ever increasing CPU usage during the processes run-time. It needs around 30 seconds to finish.
On another machine (granted, in terms of hardware it's beefier), it runs much faster. The point is, that it runs much faster as I would expect from comparing the hardware specs (8GB vs 12GB memory, 8 Cores vs 4 Cores, SunOS 5.10 Generic_147441-01 i86pc i386 i86pc
vs SunOS 5.10 Generic_127128-11 i86pc i386 i86pc
). But that's not the real point. My primary problem is that echo ::memstat | mdb -k
takes 30 seconds to complete.
Can somebody please explain what's going on here? What could explain the "slowness"?
::memstat
operation requires a large number of TLB shootdowns that require full inter-CPU synchronization. (See here for an explanation of why and what you can do about it.)uname
details)cat /etc/release
gives meSolaris 10 8/07
on the slow machines, andOracle Solaris 10 8/11
on the faster machines. So it seems that this is the problem. Could you post an answer with something like "older versions of mdb is inherently slow for::memstat
! Upgrade!" so I can accept your answer? Credit where credit is due ;)