4. Operate Running Systems
πRed Hat Certified System Administrator (RHCSA β EX200)
This topic is very important for the RHCSA exam. You must know how to:
- View running processes
- Identify high CPU usage
- Identify high memory usage
- Kill unwanted or problematic processes
- Manage processes (foreground, background, priorities)
Everything in this section is done using command-line tools.
1. Understanding What a Process Is
A process is a running program.
Examples in an IT environment:
- A web server running (httpd)
- A database service running (mysqld)
- A backup job running
- A script running in the background
Each running program:
- Has a PID (Process ID)
- Uses CPU
- Uses Memory (RAM)
- Belongs to a user
2. Viewing Running Processes
2.1 Using ps Command
The ps command shows process information.
Basic usage:
ps aux
Important columns:
- USER β Who started the process
- PID β Process ID
- %CPU β CPU usage
- %MEM β Memory usage
- COMMAND β Program name
Show processes in full format:
ps -ef
Filter a specific process:
ps aux | grep httpd
You must know how to find a process by name using grep.
3. Real-Time Process Monitoring
3.1 Using top
top
This shows real-time system activity.
Important areas in top:
Top Section:
- Load average
- CPU usage
- Total memory
- Used memory
- Free memory
Process Section:
Columns:
- PID
- USER
- %CPU
- %MEM
- COMMAND
Inside top, useful keys:
Pβ Sort by CPU usageMβ Sort by memory usagekβ Kill a processqβ Quit
You must know how to:
- Identify high CPU process
- Identify high memory process
- Kill process from inside top
3.2 Using htop (if available)
htop is not required but may exist. It is more visual than top.
4. Identifying CPU-Intensive Processes
CPU-intensive processes:
- Backup compression
- Database queries
- Infinite loops in scripts
- Misconfigured applications
To identify:
Method 1:
top
Sort by CPU using P
Method 2:
ps aux --sort=-%cpu
This shows highest CPU at the top.
5. Identifying Memory-Intensive Processes
Memory-intensive processes:
- Java applications
- Databases
- Virtual machines
- Memory leak in applications
Method 1:
top
Sort using M
Method 2:
ps aux --sort=-%mem
6. Understanding Process States
Process states include:
- R β Running
- S β Sleeping
- D β Uninterruptible sleep
- T β Stopped
- Z β Zombie
You may see these in ps output.
Zombie processes:
- Finished but not cleaned up
- Usually fixed by restarting parent process
7. Killing and Managing Processes
This is a very important RHCSA skill.
7.1 Using kill
Syntax:
kill PID
Example:
kill 1234
This sends default signal SIGTERM (15).
What is SIGTERM?
- Politely asks process to stop
- Allows cleanup
7.2 Force Kill (If Normal Kill Does Not Work)
kill -9 PID
This sends SIGKILL (9).
- Immediate stop
- No cleanup
- Use only if necessary
Exam tip:
Always try normal kill first before using -9.
7.3 Kill by Name β pkill
pkill httpd
Kills all processes with that name.
7.4 Kill by Name β killall
killall httpd
Kills all processes matching name.
8. Process Priorities (Nice and Renice)
Linux uses priority levels.
Lower nice value β Higher priority
Higher nice value β Lower priority
Nice range:
-20 (highest priority)
to
19 (lowest priority)
Default nice value = 0
8.1 Start Process with Nice Value
nice -n 10 command
Example:
nice -n 10 tar -czf backup.tar.gz /data
This lowers priority so it does not affect system performance.
8.2 Change Priority of Running Process
renice 5 PID
Example:
renice 10 1234
Only root can set negative nice values.
9. Background and Foreground Processes
9.1 Run in Background
Add & at the end:
sleep 100 &
Check jobs:
jobs
9.2 Bring Job to Foreground
fg %1
9.3 Stop a Process Temporarily
Press:
Ctrl + Z
Then:
bg
To continue in background.
10. Using free to Check Memory
free -h
Shows:
- Total memory
- Used memory
- Free memory
- Swap usage
Important for identifying memory problems.
11. Using uptime
uptime
Shows:
- How long system running
- Load average
Load average:
- 1 minute
- 5 minutes
- 15 minutes
High load average may indicate CPU problem.
12. Practical Exam Skills You Must Know
For RHCSA, you must be able to:
β
Use ps to find a process
β
Use top to identify CPU usage
β
Use top to identify memory usage
β
Kill a process using PID
β
Use kill -9 when necessary
β
Use pkill or killall
β
Start process in background
β
Use jobs, fg, bg
β
Change process priority using nice
β
Modify priority using renice
13. Common IT Scenarios in Real Environments
Scenario 1 β Web Server Overloading CPU
- Use
top - Identify process (e.g., httpd)
- Check PID
- Restart service or kill process
Scenario 2 β Backup Job Using Too Much CPU
- Identify process
- Use
reniceto reduce priority - Do NOT kill if it is critical
Scenario 3 β Application Hung
- Try: kill PID
- If not working: kill -9 PID
14. Important Exam Tips
- Always check process using
psortop - Do not randomly kill system processes
- Try normal kill before force kill
- Remember nice range (-20 to 19)
- Practice using
topsorting - Know how to background and foreground jobs
- Be comfortable using only terminal (no GUI)
Final Summary
For RHCSA EX200 Section 4.4, you must fully understand:
- What processes are
- How to monitor CPU and memory
- How to identify heavy processes
- How to kill processes safely
- How to adjust priorities
- How to manage foreground/background jobs
If you master these commands:
ps
top
kill
kill -9
pkill
killall
nice
renice
jobs
fg
bg
free
uptime
You will be fully prepared for this objective in the RHCSA exam.
