Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to find SCO UNIX slowdowns

Status
Not open for further replies.

FLAdmin

MIS
Mar 6, 2006
33
0
0
US
I have a SCO UNIX 6.0 Box, it runs FoxPro 2.6 as it's main purpose thru telnet.

my problem is that from time to time the system slows down to crawling speeds. I have olympus tuneup and it lets me view system hogs etc... unfortunately it only gives me a crappy CPU TIME instead of percentage like a windows task manager...

my question is, how do i find the hog that particular minute? in percent of CPU Used just like you would see windows in a split second by glancing at he task manager.

even better if there is anything that can do this remotely from a windows machine and with a GUI cpu grid.

Unfortunately there is not much we can do to upgrade this machine. By today's standards in hardware, the support is antique at best... I couldn't even really get it going in VMWare. I mean I did get SCO 6 running in VMWare but the network is crippled at 10Mbit wich is useless for what i want to do.

In case any of you are wondering SCO 5.06 does not work in it, it will give you kernel panics even after all patches.


 
This is a bit crude, but should show you quickly which process(es) are taking up the majority of a CPU's attention at any point in time.

Code:
ps -e -o "pcpu" -o "pid=" -o "time" -o "ruser=" -o "args=" |
awk '$1 > 5.00' |
sort -r -n

It the example above, anything taking more than 5% of the CPU is displayed. You may need to alter that threshold to suit your needs. On very fast boxes, I've had to set it as low as 0.20 to get ANYTHING to display.



"Proof that there is intelligent life in Oregon. Well, Life anyway.
 
I managed to write a little script to do this sorta...

if anyone can edit it to make it better please let me know:

trap 'echo "$CN\c";trap 0;exit' 0 2 3 15
trap 'trap 0;exit' 1
N=`tput lines`
EL=`tput el` ED=`tput ed` CL=`tput clear` HO=`tput home`
CF=`tput civis` CN=`tput cnorm` F="%12.2f%3d$ED$HO"
echo "$CF$CL\c"
HDR="`ps -p1 -opid -opcpu -oc -ouser -oargs | head -1`"
while :
do
ps -e -opid= -opcpu= -oc= -ouser= -oargs= |
sort -rn +1 |
mawk -v H="$HDR" -v N="$N" -v E="$EL" -v F="$F" '
BEGIN{print H;N-=2}
$2>0||$3{print substr($0,1,79) E;P+=$2;C+=$3}
NR>=N{exit}
END{printf F,P,C}'
sleep ${1-1} # sleep time on script's command line (default 1 sec.)
done
 
I just tried it... yes there is...

but the information shown is useless as far as i can tell...

I just decided to use the script i made above but slightly modified and dump the output to a file every 5 secs...

then i grab it and parse it with a real application i wrote in windows (vb.net 2.0). Now I have really nice graphs, grouped by process categories, sums of processing per user and the ability to kill processes just by right clicking. It's like a nicer task manager.

If anyone is interested after I figure out a few nitty gritty details to clean up my code and make it a single

component I'll release it. I can't believe no one has ever really made one of these visual task managers besides spotlight on unix wich doesen't work with SCO.

it looks like this:

|----------------------------------------_[]X|
|PID USER CPU% C ProcessName |
|--------------------------------------------|
|Data goes here in a spreadsheet type grid |
|right click to add filters on any column |
|--------------------------------------------|
|here are multi colored visual grid lines |
|--------------------------------------------|
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top