Red Hat Bugzilla – Bug 55862
top resource usage
Last modified: 2007-04-18 12:38:06 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.4) Gecko/20010917
Description of problem:
It appears that certain kinds of processes - threaded apps in particular,
but not all of them - cause top to consume lots of cpu (mostly in system
usage, not user). This has been tracked down to access to the
/proc/$pid/statm (and sometimes stat) files being the cpu-hogging calls.
"time cat /proc/$pid/statm" looks like this for a process that negatively
impacts top cpu usage:
# time cat /proc/14080/statm
577836 577747 2192 321 255475 321951 575555
while the same command for most processes looks like this:
# time cat /proc/16577/statm
202 202 180 7 0 195 26
"ps" on the processes also seems to crawl when looking at those processes.
This doesn't appear to happen when using any particular kernel version - it
happens or doesn't based on the processes running on the machine.
--Red Hat has looked into this and it appears that it is due to a
costly entry in /proc.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1.Run highly threaded app.
I believe that this was addressed with the statm patches which are now in advanced server.