OVERVIEW --

SNOOPY is a program that collects and displays information about a single
process at a selected time interval. It is particularly useful in
determining what resources a process is using. SNOOPY requires WORLD
privilege to monitor any process in the system and GROUP privilege to
monitor any process in the same UIC group. SNOOPY does not have any command
qualifiers and does not have to be set up as a foreign command.

SNOOPY is written in Pascal and was linked with VMS version 4.4. I have
included the object module for those of you who do not have the Pascal
compiler and are running a version of VMS earlier than 4.4. Simply relink
the object module. You may include the /DEBUG option in the link command
since I compiled with the /DEBUG and /NOOPTIMIZE options.

When SNOOPY is first started, it displays a list of non-system processes.
The following information is given for each process:

	1. Process Index
	2. Process name
	3. Owner (Username)
	4. Login time
	5. Process state
	6. Image being executed

Next, SNOOPY asks you to enter the index of the process you want to monitor
along with the monitor interval in seconds. Enter the index in hexidecimal
(case doesn't matter) and the interval in decimal.

SNOOPY then displays the process metrics continously. Items that change
between intervals are highlighted to allow ready identification of changes.
A typical display follows:

-------------------------------------------------------------------------------
 Username  >> JFL                      Proc Name >> Watch Dog
 Created   >> 28-SEP-1986 10:49:21.57  Elap Time >>    4 23:15:08.40
 Curr Time >>  3-OCT-1986 10:04:29.97  CPU Time  >>    0 00:03:22.17
 CLI Name  >> DCL                      CPU Limit >>    0 00:00:00.00

 Image Name>> HSC000$DUA6:[SYS0.SYSCOMMON.][SYSEXE]WATCHDOG.EXE;39

 Term >>                 Proc Id >> 2040012C        Proc Stat >> 00140011
 UIC  >>   [1,4]         Own PID >> 2040012C        State     >> HIB
 Mode >> OTHER           Account >> 83394901        Priority  >> 10/10
 Indx >> 2C              UAF Flg >> 00000000        Image Cnt >>    0

 WS Def   >>   200    Proc Page Cnt >>      35    Dir IO Count >>   34268/   0
 WS Quota >>   350    Gbl Page Cnt  >>       0    Buf IO Count >>   10408/   0
 WS Ext   >>   500    Phys Page Cnt >>      35    Cur Page Flts>>   94314/   0
 WS Size  >>   290    Curr Vrtl Mem >>    1105    Ave Page Flts>>     466/   0
 Peak WS  >>   215    Peak Vrtl Addr>>     545    CPU Percents >>       0/   0

     Process Quotas (Limit/Used)                         Privilege Masks
 Job  >>   0/  0       AST   >>    24/    1          Curr  >> DFFFFFFFFFFFFFFF
 Proc >>   8/  0       ENQ   >>    30/    0          Auth  >> DFFFFFFFFFFFFFFF
 BIO  >>  18/  0       Timer >>     8/    0          Proc  >> DFFFFFFFFFFFFFFF
 DIO  >>  18/  0       Byte  >>  8128/    0          Image >> 0000000000000000
 File >>  16/  1
-------------------------------------------------------------------------------

The process shown in the example is a process that runs "in the background"
and wakes up periodically to check our system. Therefore it shows a very
small ratio of CPU time to elapsed time. It also frees up most of its'
process space when it hibenates so the physical page count is much lower
than when it is running.

The upper half of the display shows process-specific information while the
lower half shows resource quotas and use. The two values displayed for Dir
IO Count, Buf IO Count, and Cur Page Flts are the total number for the
process and the average per second for the current interval. For Ave Page
Flts they are the average per CPU second and the average per elapsed second.
The average per CPU second can be several hundred on the larger processors.
Finally, the CPU percents are average per second for the entire process
lifetime and average per second for the current interval.

OPERATION --

SNOOPY has only a few "operating controls":

	1. SNOOPY will beep and display *** PROCESS SUSPENDED ** in the
           lower right-hand corner of the display if the process suspends,
           is outswapped, or placed in MWAIT state. This is a reminder that
           the current display is not completely valid. This should clear
           up in the next display interval. If the warning doesn't clear,
           then your system may be exhibiting signs of overloading. See the
           system managers guide and the guide to system performance for
           more information on system loading and tuning.

        2. SNOOPY traps broadcast messages. When it does so, it beeps and
           displays **** MESSAGE **** at the bottom of the display. You can
           view the message by pressing the RETURN key. Press RETURN again
           to resume the full display. SNOOPY does not stack messages so if
           a second message is received before the first one in viewed, the
           first one will be lost.

	3. CTRL R or CTRL W will refresh the display. CTRL Z or CTRL C will
           cause SNOOPY to exit. CTRL Y will interrupt SNOOPYs execution.

GENERAL NOTES --

Careful monitoring of specific processes over a period of time can be a real
aid in tuning a system by the means of adjusting various processes' working
sets. You can effect considerable savings of memory and significant
performance improvement by this technique. While this document is not
intended as a tutorial, I have found that in general, working set default
should be set low (but never less than 100 pages), working set quota should
be set to a value that trades off page faulting for memory use, and working
set extent can be set to a rather generous amount (providing your system
isn't memory limited). A good initial value for working set default is the
maximum observed value of physical page count for the image most commonly
run by the process.

If you have problems, you may contact me by phone. You may also send
comments, bug reports, etc by mail. Unfortunately, I am unable to return
calls or reply by mail due to time constraints and our company phone system.
My address and phone number are:

		Joe Lawrence
		Rockwell International
		400 Collins Rd, NE
		Mail Station 124-114
		Cedar Rapids, IA, 52498
		(319) 365-4296
