Linux Process Management
Monitor, Control & Optimize Processes Like a DevOps Engineer
Linux Process Management
Monitor, Control & Optimize Processes Like a DevOps Engineer
1. Introduction (ELI5 Mode)
Linux mein jab bhi aap koi program chalate hain, wo ek Process ban jata hai. Har process ko Linux Kernel manage karta hai taaki server crash na ho.
2. Core Concepts: PID, FG, BG
- PID (Process ID): Har process ka unique Aadhaar Card number.
- Foreground: Jo aapke screen par abhi chal raha hai.
- Background: Jo piche khamoshi se chal raha hai (Jaise backup scripts).
- Nice Value: Priority level. -20 matlab VIP (sabse pehle access), 19 matlab aam aadmi.
3. Essential Commands Toolbox 🛠️
Live Resource Monitoring (Pro Dashboard):
Kyun? CPU aur RAM usage real-time mein graphical format mein dekhne ke liye.
List Specific Processes:
Kyun? Yeh check karne ke liye ki Nginx server chal raha hai ya nahi.
4. 15 Real-World DevOps Scenarios 🔥
1. Killing a Stuck Process
Situation: Server hang hai aur ek PID 1234 CPU kha raha hai.
Result: Forcefully process band ho jayega.
2. Monitoring CPU Usage
Situation: Check karna hai kaunsa process sabse zyada load de raha hai.
Result: CPU usage ke hisab se sorting.
3. Run Script in Background
Situation: Backup script chalani hai aur dusra kaam bhi karna hai.
Result: Terminal free rahega, kaam piche chalega.
[In the same way, total 15 scenarios are integrated into the full course content]
🚀 5 Hands-on DevOps Projects
Scenario: Server slow hai.
1. htop chalayein. 2. CPU spikes dekhein. 3. lsof -p PID se open files dekhein. 4. Problem identify karein.
Scenario: Service apne aap restart honi chahiye.
1. sudo systemctl edit nginx. 2. Add: Restart=always. 3. Save & Reload.
Scenario: Process delete hone ke baad bhi resource kha raha hai.
1. ps -ef | grep defunct. 2. Parent PID dhunde. 3. Kill parent PID.
Scenario: 5 scripts background mein manage karni hai.
1. jobs command dekhein. 2. fg %1 se wapas layein.
Scenario: Script jo 90% CPU par alert de.
1. top -bn1 output save karein. 2. Awk se CPU value nikalein. 3. Alert mail bhejein.
Summary 🎯
Linux Process Management ek DevOps engineer ki sabse badi power hai. htop se monitor karo, kill se control karo, aur systemctl se automate karo. Real DevOps mein ye daily kaam aata hai.