CPU load and Disk I/O and load

CPU load and Disk I/O and load

Post by Raj Calis » Tue, 18 Apr 2000 04:00:00



Hi all,

I work on Digital Unix V4.0D. I need to write a program that
determines the load on the CPU and also gather disk I/O
statistics. From these two things, I need to determine if
the system is loaded or not based some some user defined
threshold(s).

I figured that I need to use the table(2) system call. Does the
load average that is returned by table() reflect (at least to
some extent) the load on the CPU? If not what else determines
it?

For disk statistics, I am not sure how to interpret
tbl_dkinfo struct. Any help in this is appreciated.

thanks.

raj...

 
 
 

CPU load and Disk I/O and load

Post by Alan Rollow - Dr. File System's Home for Wayward Inode » Tue, 18 Apr 2000 04:00:00



>I work on Digital Unix V4.0D. I need to write a program that
>determines the load on the CPU and also gather disk I/O
>statistics. From these two things, I need to determine if
>the system is loaded or not based some some user defined
>threshold(s).

As someone else suggested, you might want to look at existing
utilities to see if they meet your needs.  If the problem is
one of formatting the data differently, then look at the programs
which collect this data and which also have sources available.
You might also want to look at collect and Monitor which should
be on the Freeware CDROM.  A newer version of Monitor is available
on gatekeeper.dec.com:/pub/DEC/monitor.alpha.tar.Z.

Quote:>I figured that I need to use the table(2) system call. Does the
>load average that is returned by table() reflect (at least to
>some extent) the load on the CPU? If not what else determines
>it?

What do you consider CPU load?  The stats available from table(2)
using the code TBL_SYSINFO record time spent in the different CPU
modes; user, nice, kernel, wait and idle.  Older versions of the
operating system only had one of these structures available for
multi-CPU systems.  I've read that V5 presents this data on a
per-CPU basis, but I don't know what V4 does.

The load average is described in the uptime manual page.  It is
a pretty good measure of overall system load, but systems are
complex and one measurement rarely describes everything that
contributes to load.

Quote:>For disk statistics, I am not sure how to interpret
>tbl_dkinfo struct. Any help in this is appreciated.

Up to the number of disks that the interface supports, each
disk on the system is allocated one of these data structures.
The first entry of the table, records the number of entries
in the table (which may be a fixed value and thus, next to
useless).  The unit and name fields correspond to the disk
for which statistics are being collected.  Through V4, I
don't believe this unit information reflects SCSI targets
that support multiple logical units making it appears that
there are multiple entries per disk.  You have to go deeper
into the kernel to see which logical unit corresponds to
which table entry.  You can look at the Monitor sources to
see how it does this.

I believe di_busy is simply a flag to indicate that the
entry represents an active disk.  The di_xfer and di_wds
field represent number of transfers completed and number
of "words" transferred by the disk.  I think the "word"
size of this data structure is 64 bytes.  It is easy enough
to verify with a simple controlled I/O test.

I suspect the di_seek field only gets counted for disks
that require an explicit seek operation to access a given
logical block.  Most modern storage protocols hide the seek
insides an I/O request for the block.  Generally you'll see
this field as zero.  I don't recall what the di_time field
counts.  Some modern versions do fill in the later stats,
which are as described in the include file.

Quote:

>thanks.

>raj...

--


 
 
 

CPU load and Disk I/O and load

Post by Dennis J. Sylveste » Sat, 29 Apr 2000 04:00:00


Go to Compaq/s site and get 'collect'.  It's a great utility and will
gather almost all the data you need as well as being very configurable.
It also has a playback feature that is very useful.

> Hi all,

> I work on Digital Unix V4.0D. I need to write a program that
> determines the load on the CPU and also gather disk I/O
> statistics. From these two things, I need to determine if
> the system is loaded or not based some some user defined
> threshold(s).

> I figured that I need to use the table(2) system call. Does the
> load average that is returned by table() reflect (at least to
> some extent) the load on the CPU? If not what else determines
> it?

> For disk statistics, I am not sure how to interpret
> tbl_dkinfo struct. Any help in this is appreciated.

> thanks.

> raj...