Posts Tagged ‘manage’

When running a computer system, several process are executed. As a System Administrator of your own computer, you have to manage the processes running on your system. Processes have to be monitored so as to check the health and use of system resources. If you are running Linux, I created a summary on creating, monitoring, and killing a process. A process is actually an executable running in the computer’s memory. Each process has an assigned unique number known as Process ID(PID).  PID’s may be up to 32757. PID’s 0 and 1 are reserved for the kernel, the heart of the Operating System and the init, the mother of all processes.

PROCESS MONITORING
ps: displays a a snap shot of the current processes in the working directory.
ps uxa: displays a snapshot of all the current  running processes.

pstree: displays a snapshot of the genealogy of processes.

top: displays all current running processes in real time.

CREATING A PROCESS
executable file: run the executable
e.g.: usr/sbin/httpd – run the httpd process

KILLING A PROCESS
kill -9 PID: terminate the process through a kenrel call
kill -15 PID: terminate a process nicely

FIELD NAMES IN PROCESS MONITORING
USER –  The user who started the process
PID – The process ID
%CPU –  Shows the cputime / realtime percentage.
%MEM – The fraction of RSS divided by the total size of RAM
VSZ – Size of virtual memory used by the process
RSS – Resident set size (Data & Text segments only) in Kb
TTY – The TTY associated with this process
STAT – The current status
TIME – CPU time in MINS:SECS
COMMAND –  The full command line used to start the process

I also included additional commands in controlling a process. to run a process in the background use & command.
e.g.: xclock &
output: [JOB_ID] PID

jobs: Lists all commands stopped, or running in the background
jobs -l: Lists PID
fg JOB_ID: force a suspended or background process to continue running in the foreground
bg JOB_ID: force a suspended process to continue running in the background