Skip to content

davidpty/dirty-writeback-monitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dirty Writeback Monitor

A lightweight terminal-based Linux monitoring tool for observing dirty memory, writeback activity and I/O pressure in real time.

The tool is designed for system engineers, performance analysts and advanced Linux users who need visibility into how memory-backed writes are flushed to disk and how this affects overall system behavior.


What This Tool Monitors

Dirty Memory

Memory pages that have been modified in RAM but not yet written to disk.

High dirty memory can indicate:

  • Write-heavy workloads
  • Delayed disk I/O
  • Potential latency spikes during forced writeback

Writeback

Pages actively being flushed from memory to disk.

Sustained writeback can indicate:

  • Disk saturation
  • Storage bottlenecks
  • I/O contention with applications

PSI (Pressure Stall Information)

Linux kernel metrics that show how often tasks are stalled waiting for I/O.

This helps correlate memory pressure with real system impact.


Key Features

  • Real-time terminal UI
  • Tracks dirty pages and writeback volume
  • Displays I/O pressure (PSI)
  • Optional per-process disk write tracking
  • No background daemon
  • No network access

Supported Platforms

  • Linux only
  • Kernel with PSI support (5.0+ recommended)
  • /proc and /sys interfaces available

Requirements

  • Python 3.9+
  • Linux kernel with writeback statistics enabled

Optional:

  • Root privileges for per-process write attribution

Install dependencies:

pip install -r requirements.txt

Installation

Clone the repository:

git clone https://github.com/davidpty/dirty-writeback-monitor.git
cd dirty-writeback-monitor

Run directly:

python dirtymon

Usage

Basic monitoring:

python dirtymon

Run with elevated privileges for per-process I/O:

sudo python dirtymon

Exit with Ctrl+C.


Interpreting the Data

  • Rising dirty memory + low writeback → disk not flushing yet
  • High writeback + high PSI → storage bottleneck
  • Low dirty + high PSI → I/O contention elsewhere

Use this tool alongside iostat, vmstat, or perf for deeper analysis.


Use Cases

  • Diagnosing disk latency spikes
  • Understanding memory writeback behavior
  • Tuning dirty ratio and writeback kernel parameters
  • Observing impact of heavy write workloads

Security & Privacy

  • All data is read locally from the kernel
  • No files are written
  • No network access

License

MIT

About

Real-time Linux monitor for dirty memory, writeback activity and I/O pressure

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages