Skip to content

DaronPopov/what_pid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

what-pid

Lightweight Linux process monitor with NFS vs local disk detection.

A production-ready tool for monitoring CPU, memory, and disk I/O on Linux servers. Reads directly from /proc - no external dependencies.

Quick Install

pip install git+https://github.com/DaronPopov/what_pid.git

Usage

what-pid

Or use the alias:

sysmon

Options

Option Description
-i, --interval SEC Refresh interval (default: 2.0, range: 0.5-60)
-n, --limit NUM Max processes to display (default: auto-fit)
-h, --help Show help
-v, --version Show version

Examples

what-pid              # Default: 2s refresh, auto-fit display
what-pid -i 1         # 1 second refresh
what-pid -n 50        # Show top 50 processes
what-pid -i 1 -n 30   # Fast refresh, 30 processes

Display

System Monitor - server01 - 14:32:01 - up 5d 12h 30m

CPU [128]: [||||||||||||             ]  48.2%  (us: 30.1% sy: 18.1% wa: 0.0%)
Mem:       [||||||                   ]  25.3%  (128.5G / 512.0G, 383.5G free)
Load avg:  8.12  7.45  6.23   (1m / 5m / 15m)

-----------------------------------------------------------
    PID     CPU%       MEM        READ       WRITE     DISK
-----------------------------------------------------------
  12345    156.2      2.3G   125.4 MB/s    45.2 MB/s   LOCAL
  12346     89.1      1.1G     0.0  B/s     0.0  B/s     NFS

Columns

Column Description
PID Process ID
CPU% CPU usage (100% = 1 core, can exceed on multi-threaded)
MEM Resident memory (M/G/T)
READ/WRITE Disk I/O rates
DISK LOCAL, NFS, or UNKNOWN

Features

  • Zero dependencies - Python standard library only
  • Multi-core aware - Correctly handles 100+ core Xeon servers
  • Large memory support - Displays TB for high-memory servers
  • NFS detection - Identifies processes using NFS vs local disk
  • Production ready - Handles 1000+ processes efficiently
  • Clean display - Auto-fits terminal, smooth refresh

Requirements

  • Linux (kernel 4.x+)
  • Python 3.6+
  • No root required (some metrics need root for full visibility)

How It Works

Reads directly from /proc:

Source Data
/proc/[pid]/stat CPU ticks
/proc/[pid]/status Memory (VmRSS)
/proc/[pid]/io Disk I/O counters
/proc/[pid]/fd/ File descriptors
/proc/stat System CPU
/proc/meminfo System memory
/proc/self/mountinfo Mount points (NFS detection)

No shell commands (ps, top, df) are used.

License

MIT

About

polling tool for ram, storage, cpu pid load

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages