1. What are the monitoring tools?
A) top, htop, atop, sar
2. What is the difference between top and htop?
A)
- top: Default Linux command, shows real-time processes, CPU, memory usage.
- htop: Interactive version of top, with a colorful interface, scrollable view, and allows killing processes easily.
3. What does the load average in top mean?
A) It shows the average number of processes waiting for CPU (or I/O) over 1, 5, and 15 minutes.
- Value < number of CPUs = system is fine.
- Value > number of CPUs = system is overloaded.
4. How do you monitor memory usage in Linux?
A)
- free -m → summary of memory usage
- top / htop → per-process memory usage
- vmstat → virtual memory stats
- sar -r → historical memory usage
5. What is the difference between uptime and w command?
A)
- uptime: Shows how long the system is running, number of users, and load average.
- w: Shows uptime plus details about logged-in users and their activities.
6. What is atop used for?
A) atop is an advanced monitoring tool that shows CPU, memory, disk, and network usage with per-process statistics. It also supports logging for historical analysis.
7. What is sar and why is it useful?
A) sar (System Activity Reporter) collects, reports, and saves performance data (CPU, memory, disk, network). It helps in analyzing historical performance trends.
8. How do you check CPU utilization in Linux?
A)
- top → CPU usage per process
- mpstat -P ALL 1 → CPU usage per core
- sar -u 1 5 → CPU usage over time
9. What is the difference between ps and top?
A)
- ps: Snapshot of current processes.
- top: Real-time, continuously updating process list.
10. How do you find the top 5 memory-consuming processes?
A)
ps aux --sort=-%mem | head -6
11. How do you check disk I/O performance?
A)
- iostat -x 1 → extended disk statistics
- iotop → per-process I/O usage
- sar -d 1 → disk activity history
12. What is the difference between iostat and iotop?
A)
- iostat: Shows disk I/O statistics per device.
- iotop: Shows real-time I/O usage by processes.
13. How do you check previous load average using atop?
A) atop saves logs in /var/log/atop/.
Use the replay option to view old data:
atop -r /var/log/atop/atop_YYYYMMDD
Inside atop, you can see the load average values along with CPU usage for that day.
14. How do you check previous load average using sar?
A) sar stores logs in /var/log/sa/saXX (XX = day of the month).
Use the queue & load option:
sar -q -f /var/log/sa/sa18
Output shows ldavg-1, ldavg-5, and ldavg-15, which are the 1, 5, and 15-minute load averages for the chosen day.