Solved

TO find CPU and IO bound processes in the system

Posted on 2003-11-21
5
648 Views
Last Modified: 2013-12-16
Hello.

The defination of load average says that it is the total number of ready-to-run processes and waiting-for-io processes averaged over 1 minute.
how do I find only the ready-to-run processes or only the waiting-for-io processes using this value and the cpu-utilized value.
(any information from sar,vmstat,iostat can be of help?)

Thank you.
0
Comment
Question by:tuxrhl
5 Comments
 
LVL 51

Accepted Solution

by:
ahoffmann earned 43 total points
ID: 9802405
see STATE codes in "ps ax" output
man ps
0
 
LVL 24

Assisted Solution

by:shivsa
shivsa earned 41 total points
ID: 9804431
Also check utility TOP.(http://www.groupsys.com/top/
in the state field u find more information about processes whether they are sleeping(waiting for io),run( ready to  run), and cpu(currently running on this cpu).
in the header u can get the fair idea about the system, how many processes are there and all.
the webpage give u lot of information how to understand the output and all. in my opinion this is the best.

top
------------------
last pid: 20676;  load averages:  0.02,  0.05,  0.07             20:59:46
69 processes:  67 sleeping, 1 running, 1 on cpu
CPU states: 0.0% idle,  98.3% user,  1.6% kernel,  0.0% iowait,  0.0% swap
Memory: 512M real, 413M swap in use, 934M swap free

  PID USERNAME THR PRI NICE  SIZE   RES STATE   TIME    CPU COMMAND
 6160 root       1  59    0 6016K 2592K run     9:06 98.06% pcgateway
14906 nobody     1  48    0   19M 5184K sleep 174:02  0.95% Collector_prog1
20673 dtucker    1  58    0 2592K 1792K cpu     0:03  0.66% top
  373 root       1  58    0   76M   13M sleep  21.4H  0.55% oserv
29562 root       1  58    0 2600K 1264K sleep   3:53  0.30% sshd
---------------------------

0
 
LVL 2

Assisted Solution

by:TheWeakestLink
TheWeakestLink earned 41 total points
ID: 9809541
Most (all?) of these utilities like vmstat, top etc. just read files in /proc to look at the kernel's various status snapshots.
I agree with shivsa about the "top" program, but be aware that top can give different info depending on how you set it up.  This applies particularly to the update frequency, and the "niceness" of various programs. Top itself can distort the figures it presents.  

Here's a small excerpt from the top man page on the area you're interested in.........

w: S  --  Process Status
          The status of the task which can be one of:
             'D' = uninterruptible sleep
             'R' = running
             'S' = sleeping
             'T' = traced or stopped
             'Z' = zombie

          Tasks  shown  as  running should be more properly thought of as 'ready to run'  --  their task_struct is simply represented on the Linux run-queue.  Even without a true SMP machine, you may see numerous tasks in this state depending on top's delay interval and nice  value.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now