Performance Monitoring

Tools for real-time system monitoring including CPU, memory, disk I/O, and network performance analysis

System Monitoring

top

  • Real-time process and resource usage
  • Press ‘q’ to quit, ‘1’ for per-CPU view

htop

  • Enhanced interactive process viewer
  • Color-coded, sortable columns

iostat -x 1

  • Disk I/O statistics every second
  • Shows utilization, wait times

vmstat 1

  • Virtual memory and system stats
  • CPU, memory, I/O summary

Memory Analysis

free -h

  • Memory usage in human-readable format
  • Shows available, used, cached

cat /proc/meminfo

  • Detailed memory information
  • All memory statistics available

Disk Performance

iotop

  • Shows I/O usage by process
  • Real-time disk read/write activity

df -h

  • Filesystem disk space usage
  • Human-readable sizes

du -sh /path/*

  • Directory size summary
  • Shows space used by folders

Network Performance

iftop

  • Network bandwidth by connection
  • Real-time traffic monitoring

nethogs

  • Network usage by process
  • Shows which apps use bandwidth

ss -tuln

  • Socket statistics
  • TCP/UDP listening ports

Process Analysis

ps aux --sort=-%cpu

  • Processes sorted by CPU usage
  • Shows all running processes

pgrep -f process_name

  • Find process IDs by name
  • Useful for scripting

Example Monitoring

1
2
3
4
5
6
7
8
# Monitor system performance
watch -n 1 'free -h && uptime'

# Check top CPU processes
ps aux --sort=-%cpu | head -10

# Monitor specific directory I/O
iotop -o -d 1