uptime provides an instantaneous summary such as 11:42pm up 18 days, 8:45, 5 users, load average: 0.01, 0.03, 0.07 For the current time, the Number of days up since last boot, the number of users currently logged in, and the load average for the last 1, 5, and 15 minute intervals. The load average (LA) is the average number of processes (the sum of the run queue length and the number of jobs currently running) that are ready to run, but are waiting for access to a busy CPU. Averages from 0 to 1.0 are acceptable for a single CPU. As a general rule of thumb, a machine is being overworked if load averages consistently exceed three times the number of CPUs. top provides load average with auto refresh and additional data (sorted by %CPU): 68 processes: 67 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 12.2% user, 1.6% system, 0.0% nice, 86.1% idle Solaris comes with the prstat command to provide this info. Graphical versions of this include gtop within Gnome and the KDE Process Monitor. For memory usage, press M. For CPU info, press P. To stop display, enter q. The 'SIZE' field is the total virtual memory size of each process, including all code, data, stack, mapped files, libraries etc. procinfo -fn30 is used to gather system data from the /proc directory every 30 seconds. o Last Boot time o Load Average § average number of jobs running § number of runnable processes § total number of processes § PID of the last process run (idem) o Swap info o Memory resources o Number of disks o IRQ info o Installed modules (with the -a or -m option) o File Systems (with the -a or -m option) xos provides a constantly updated colorful summary view of various components. | | |
Option -f shows child processes. For each Unique Process ID (PID): "SIZE" = Virtual image size; KB of text+data+stack Or "SZ" in Solaris, for memory consumption. "RSS" = Resident Set Size (kilobytes of program in memory). "SHARE" = Amount of shared memory used by the task. "TTY" = Controlling tty on which the process was started. "STAT" = Status of each process. In Solaris, "S": S = Sleeping R = Running (active) D = uninterruptible sleep T = traced (stopped) Z = zombie process Second field = "W" if the process has no resident pages. Third field = "N" if the process has a positive nice value. "NI" in Solaris for The nice value (priority) of the process. In solaris, option -l (for long) shows these additional columns: "F" for any flags set by the process. "ADDR" for the number of memory addresses used by the process. "WCHAN" for the memory addresses for processes that are sleeping. "PPID" for the parent process ID. "PRI" for the process priority cc"C" for the scheduling class of the process. "STIME" for the date/time when the process was started. ps -a lists the most frequently requested processes. Other flags include: -d Lists all processes -t Lists all processes associated with a specific terminal -u Lists all processes for a specific user -f Prints comprehensive process information -c Lists processes in scheduler format -g Prints process information on a group basis for a single group -G Prints process information on a group basis for a list of groups -j Includes SID and PGID in printout -l Prints complete process information -L Displays LWP details -p Lists process details for list of specified process -P Lists the CPU ID to which a process is bound -s Lists session leaders To filter only processes of the current user in Linux: ps aufx | grep $USER To scroll up and down in Linux: ps -a | less Syntax: ps [-a] [-A] [-c] [-d] [-e] [-f] [-j] [-l] [-L] [-P] [-y] [ -g grplist ] [ -n namelist ] [-o format ] [ -p proclist ] [ -s sidlist ] [ -t term] [ -u uidlist ] [ -U uidlist ] [ -G gidlist ]
| |