This chapter describes procedures that you, as the system administrator, can use to manage processes.
You can also see Process Management in the AIX Version 4.3 System Management Concepts: Operating System and Devices and the AIX Version 4.3 System User's Guide: Operating System and Devices for basic information on managing your own processes; for example, restarting or stopping a process that you started or scheduling a process for a later time. The AIX Version 4.3 System User's Guide: Operating System and Devices also defines terms that describe processes, such as daemons and zombies.
The ps command is the primary tool for observing the processes in the system. Most of the flags of the ps command fall into one of two categories:
The most widely useful variants of ps for system-management purposes are:
To identify the current heaviest users of CPU time, you could enter:
ps -ef | egrep -v "STIME|$LOGNAME" | sort +3 -r | head -n 15
This will list, in descending order, the 15 most CPU-intensive processes other than those owned by you.
For more specialized uses, the following two tables are intended to simplify the task of choosing ps flags by summarizing the effects of the flags.
Process Listed are: | Process-Specifying Flags: | ||||||||||||
-A | -a | -d | -e | -G -g |
-k | -p | -t | -U -u |
a | g | t | x | |
All processes | Y | - | - | - | - | - | - | - | - | - | Y | - | - |
Not processes group leaders and not associated with a terminal | - | Y | - | - | - | - | - | - | - | - | - | - | - |
Not process group leaders | - | - | Y | - | - | - | - | - | - | - | - | - | - |
Not kernel processes | - | - | - | Y | - | - | - | - | - | - | - | - | - |
Members of specified-process groups | - | - | - | - | Y | - | - | - | - | - | - | - | - |
Kernel processes | - | - | - | - | - | Y | - | - | - | - | - | - | - |
Those specified in process number list | - | - | - | - | - | - | Y | - | - | - | - | - | - |
Those associated with tty(s) in the list | - | - | - | - | - | - | - | Y (n ttys) |
- | - | - | Y (1 tty) |
- |
Specified user processes | - | - | - | - | - | - | - | - | Y | - | - | - | - |
Processes with terminals | - | - | - | - | - | - | - | - | - | Y | - | - | - |
Not associated with a tty | - | - | - | - | - | - | - | - | - | - | - | - | Y |
Column: | Column-Selecting Flags: | |||||||||
Default1 | -f | -l | -U -u |
Default2 | e | l | s | u | v | |
PID | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y |
TTY | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y |
TIME | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y |
CMD | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y |
USER | - | Y | - | - | - | - | - | - | Y | - |
UID | - | - | Y | Y | - | - | Y | - | - | - |
PPID | - | Y | Y | - | - | - | Y | - | - | - |
C | - | Y | Y | - | - | - | Y | - | - | - |
STIME | - | Y | - | - | - | - | - | - | Y | - |
F | - | - | Y | - | - | - | - | - | - | - |
S/STAT | - | - | Y | - | Y | Y | Y | Y | Y | Y |
PIR | - | - | Y | - | - | - | Y | - | - | - |
NI/NICE | - | - | Y | - | - | - | Y | - | - | - |
ADDR | - | - | Y | - | - | - | Y | - | - | - |
SZ/SIZE | - | - | Y | - | - | - | Y | - | Y | Y |
WCHAN | - | - | Y | - | - | - | Y | - | - | - |
RSS | - | - | - | - | - | - | Y | - | Y | Y |
SSIZ | - | - | - | - | - | - | - | Y | - | - |
%CPU | - | - | - | - | - | - | - | - | Y | Y |
%MEM | - | - | - | - | - | - | - | - | Y | Y |
PGIN | - | - | - | - | - | - | - | - | - | Y |
LIM | - | - | - | - | - | - | - | - | - | Y |
TSIZ | - | - | - | - | - | - | - | - | - | Y |
TRS | - | - | - | - | - | - | - | - | - | Y |
Environment (following the command) |
- | - | - | - | - | Y | - | - | - | - |
If ps is given with no flags or with a process-specifying flag that begins with a minus sign, the columns displayed are those shown for Default1. If the command is given with a process-specifying flag that does not begin with minus, Default2 columns are displayed. The -u or -U flag is both a process-specifying and column-selecting flag.
The following are brief descriptions of the contents of the columns:
For a detailed discussion of process-priority alteration, see "Controlling Contention for the CPU" in AIX Versions 3.2 and 4 Performance Tuning Guide. Basically, if you have identified a process that is using too much CPU time, you can reduce its effective priority by increasing its nice value with renice. For example:
renice +5 ProcID
The nice value of the ProcID's would increase process from the normal 20 of a foreground process to 25. To reset process ProcID's nice value to 20, you would have to be root and enter:
renice -5 ProcID
Use the kill command to end a process. The kill command sends a signal to the designated process. Depending on the type of signal and the nature of the program that is running in the process, the process may end or may keep running. The signals you would send are:
Normally, it is desirable to issue SIGTERM rather than SIGKILL. If the program has a handler for SIGTERM, it can clean up and terminate in an orderly fashion. You would issue:
kill -term ProcessID
(The -term could be omitted.) If the process does not respond to the SIGTERM, enter:
kill -kill ProcessID
On multiprocessor systems, you can bind a process to a processor or unbind a previously bound process from:
Note: While binding a process to a processor may lead to improved performance for the bound process (by decreasing hardware-cache misses), overuse of this facility could cause individual processors to become overloaded while other processors are underused. The resulting bottlenecks could reduce overall throughput and performance. During normal operations, it is better to let the operating system assign processes to processors automatically, distributing system load across all processors. Bind only those processes that you know will benefit from being run on a single processor.
You must have root user authority to bind or unbind a process you do not own.
Binding or Unbinding a Process Tasks | ||
---|---|---|
Web-based System Manager: wsm processes
fast path (Processes application) -OR- | ||
Task | SMIT Fast Path | Command or File |
Binding a Process | smit bindproc | bindprocessor -q |
Unbinding a Process | smit ubindproc | bindprocessor -u |