Skip to content
-
Subscribe to our newsletter & never miss our best posts. Subscribe Now!
digitalnewsservices.com
digitalnewsservices.com
  • Home
  • Linux
  • Git
  • Docker
  • Jenkins
  • Kubernetes
  • DevOps Projects
  • Home
  • Blog
  • Home
  • Linux
  • Git
  • Docker
  • Jenkins
  • Kubernetes
  • DevOps Projects
  • Home
  • Blog
Close

Search

  • https://www.facebook.com/
  • https://twitter.com/
  • https://t.me/
  • https://www.instagram.com/
  • https://youtube.com/
Subscribe
digitalnewsservices.com
digitalnewsservices.com
  • Home
  • Linux
  • Git
  • Docker
  • Jenkins
  • Kubernetes
  • DevOps Projects
  • Home
  • Blog
  • Home
  • Linux
  • Git
  • Docker
  • Jenkins
  • Kubernetes
  • DevOps Projects
  • Home
  • Blog
Close

Search

  • https://www.facebook.com/
  • https://twitter.com/
  • https://t.me/
  • https://www.instagram.com/
  • https://youtube.com/
Subscribe
Home/Linux/Linux Process Management
Linux

Linux Process Management

By Sumit Sharma
April 19, 2026 3 Min Read
0

Monitor, Control & Optimize Servers Like a Senior DevOps Architect

Chapter 6: System Operations

Linux Process Management

Monitor, Control & Optimize Servers Like a Senior DevOps Architect

1. Introduction (ELI5 Mode)

Think of Linux as a kitchen. Every person cooking a dish is a ‘Process’. Every process has an ID card (PID). If someone burns the food, the Manager (DevOps) must stop them (Kill).
Asaan bhasha mein: Jab bhi Linux mein koi program (jaise Nginx ya Script) chalta hai, use “Process” kehte hain. Har process ko ek unique number milta hai jise PID (Process ID) kehte hain.

DevOps me kyun? Agar server slow hai, toh aapko pata hona chahiye kaunsa process CPU kha raha hai aur use kaise handle karna hai.

2. Core Concepts

A. PID (Process ID)

Yeh har process ka Aadhaar Card number hai. Bina PID ke aap kisi process ko touch nahi kar sakte.

B. Foreground vs Background

  • Foreground: Jo aapke screen par chal raha hai (Terminal block hai).
  • Background: Jo piche khamoshi se chal raha hai (Terminal free hai).

3. The DevOps Toolbox (Commands) 🛠️

Monitor Live Resources (The Dashboard):

htop
# Real DevOps me ‘top’ se zyada ‘htop’ use hota hai kyunki ye colorful aur intuitive hai.

List Specific Processes:

ps aux | grep nginx
# Nginx ki sari processes ko list karne ke liye.

Forcefully Stop a Process:

4. 15 Real-World DevOps Scenarios 🔥

1. Killing Stuck Process

kill -9 4567

Ziddi process jo hang ho gaya ho.

2. Check CPU Consumption

top -o %CPU

Pata karo kaunsa process server par bojh hai.

3. Run Backup in Background

./backup.sh &

Script piche chalti rahegi, aap kaam karte raho.

4. Restart Crashed Nginx

sudo systemctl restart nginx

Production server par website wapas zinda karna.

5. Monitor Service Status

systemctl status docker

Check karo Docker active hai ya dead.

6. Find Process by Name

pgrep -l python

Sari python scripts ki PID ek sath dekhna.

7. Lowering Priority (Nice)

nice -n 10 ./script.sh

Script ko kam CPU priority dena.

8. Real-time Memory Check

watch -n 1 free -m

Har second RAM usage update dekhna.

9. Bringing BG to FG

fg %1

Background job ko wapas screen par lana.

10. Check All Logs

journalctl -xe

Process kyu fail hua, error dekhne ke liye.

…and 5 more scenarios like managing zombie processes and renicing active jobs.

🚀 5 Hands-on DevOps Projects

Project 1: Monitor Production Server Performance

Scenario: Server load high hai. Identify the issue.
1. Run htop. 2. Press ‘F6’ to sort by MEM. 3. Find top memory eater. 4. Check logs using tail -f /var/log/syslog.

Project 2: Auto Restart Critical Service

Scenario: Nginx crash ho raha hai.
1. sudo systemctl stop nginx. 2. sudo systemctl start nginx. 3. Verify using systemctl is-active nginx.

Project 3: Kill High CPU Process Safely

Scenario: Unwanted python script consuming 90% CPU.
1. ps aux | grep python. 2. Identify PID. 3. kill 1234. 4. Verify process is gone.

Project 4: Background Job Manager

Scenario: Large log compression task.
1. tar -czf backup.tar.gz /var/log &. 2. Use jobs to monitor. 3. Use disown to keep it running after logout.

Project 5: Automated Process Monitoring Script

Scenario: Create a Bash script to alert if CPU is > 80%.

#!/bin/bash
CPU=$(top -bn1 | grep "Cpu(s)" | awk '{print $2}' | cut -d. -f1)
if [ $CPU -gt 80 ]; then echo "High CPU Alert!"; fi

Summary: Key Takeaways 🎯

1. PID is the key to control any process.
2. htop is your best friend for live monitoring.
3. kill -9 is a power you should use carefully.
4. systemctl manages the life cycle of your server services.

Next Step: Chapter 6 ka Quiz pass karein aur Certificate earn karein!

Author

Sumit Sharma

Follow Me
Other Articles
Previous

Linux Process Management

Next

No Comment! Be the first one.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • Dockerfile — Build Production-Ready Images Like a DevOps Engineer
  • Docker Images & Containers
  • Docker Introduction — Learn Containers with Real DevOps Projects (Beginner to Advanced)
  • Git Branching & Team Collaboration — Work Like a Real DevOps Engineer
  • Remote Repositories & Cloud Workflow

Recent Comments

No comments to show.

Archives

  • April 2026

Categories

  • Docker
  • Git
  • Linux
  • Uncategorized
Copyright 2026 — digitalnewsservices.com. All rights reserved. Blogsy WordPress Theme