[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-users] CPU Heavily Loaded



On Thu, 23 Aug 2001 09:59:24 -0400, Dave mumbled something like:
>>After a few seconds everything returned to normal, and right now
>>everything
>>is functioning properly. Is there any way to find out which virtual
>>site is
>>causing this problem?

Dave,
There might be another (better) way, but the only way I know how is 
to watch the output of top for a while and see if you can see little 
surges here and there.
>From command line as root type "top" (no quotes). Once you're in 
there, you can press the "h" key to get a list of all of the fields 
that are displayed - this is really useful in taking out certain 
fields that are just extraneous info and make the top output wider 
than the screen. While looking at the help screen, just hit the 
letter associated with a field and that field either will or will not 
be displayed (fields currently being displayed have an asterisk next 
to them). Return to the top output by hitting your space bar.
Once you've got the fields down to a manageable size, where you can 
see everything on the screen, press the "c" key - this will turn the 
process into full command-line calls that will let you see exactly 
what site and what script is being accessed. 
Make sure you've left the CPU and memory usage on the screen, hit "p" 
(or it might be a capital p - "P") to sort the list by CPU usage, and 
then just watch the processes at the top of the list. When you see 
something really hit the CPU hard, make a note of the command line 
that's with it, and then go investigate that script.

Thinking on this, you could probably write a little shell script that 
logged the output of top to a file every 5 minutes or so, which would 
give you a nice little snapshot that you could refer back to.
Does anyone have a script like this handy?

HTH!
--
CarrieB
"This year will go down in history. For the first time, a civilized 
nation has full gun registration! Our streets will be safer, our 
police more efficient, and the world will follow our lead into the 
future." --Adolf Hitler, 1935