Systems Engineering · Field Notes

Notes from 14 years of debugging Linux, PostgreSQL & Python in production.

I build and troubleshoot large-scale distributed storage and backend infrastructure. PureKit is where I document real-world root causes—from glibc malloc arenas and systemd namespaces to logrotate deadlocks and split-brain networks.

14+ yrs
Linux, Backend & Distributed Storage
200+ Nodes
Cluster Scale & Production Forensics
Evidence First
Measure, Reproduce, Then Fix

Areas of Focus

What I spend most of my engineering time on
01

Production Incident Forensics

Tracing hard-to-reproduce failures across Linux filesystems, systemd/udev sandboxes, VRRP networks, and silent upgrade scripts using core dumps, stat, lsof, and nsenter.

LinuxPostgreSQLsystemdVRRPForensics
02

Runtime & Memory Performance

Dissecting high RSS growth, glibc malloc arena retention, Python GIL contention, and concurrency races with py-spy, pmap, and controlled experiments.

Pythonpy-spypmapglibcConcurrency
03

Observability & Security Engineering

Designing low-overhead Prometheus telemetry with hot-reload and TLS/mTLS, and building automated scanners to catch RBAC authorization gaps systematically.

PrometheusTLS/mTLSRBACTooling

Engineering Notes & Postmortems

Sanitized, real-world production write-ups

How logrotate copytruncate Deadlocked a 349 GB PostgreSQL Log for 386 Days

Forensic root-cause analysis using stat timestamps and zero-downtime disk recovery on a production PostgreSQL host.

Read note →
How logrotate copytruncate Deadlocked a 349 GB PostgreSQL Log for 386 Days

Why a 64-Core Linux Box Made Our Python Service Eat 7.6 GB RAM Every 2 Hours

Profiling 370 live thread stacks with py-spy and pmap to uncover three compounding causes behind OOM restarts and API timeout storms.

Read note →
Why a 64-Core Linux Box Made Our Python Service Eat 7.6 GB RAM Every 2 Hours

Building a Production Prometheus Monitoring Framework for Database & Linux Clusters

Designing custom PostgreSQL/cache collectors, config hot-reload, high-cardinality guardrails, and TLS/mTLS encryption from scratch.

Read note →
Building a Production Prometheus Monitoring Framework for Database & Linux Clusters

Why systemd ProtectHostname=yes Broke udev Scripts After Host Rename

Tracing an isolated UTS namespace with nsenter to uncover why disk auto-replacement scripts kept seeing 'localhost' on renamed Linux nodes.

Read note →
Why systemd ProtectHostname=yes Broke udev Scripts After Host Rename

Multithreaded fork() & os.popen() Corrupting glibc into Python SIGSEGV

Disassembling production core dumps to pinpoint a concurrency race inside glibc's internal open-stream list.

Read note →
Multithreaded fork() & os.popen() Corrupting glibc into Python SIGSEGV

Turning 3 Pen-Test Findings into a 66-Endpoint Authorization Overhaul

Writing an automated full-stack permission scanner that uncovered 66 read-only write bypasses and guarded 421 frontend routes.

Read note →
Turning 3 Pen-Test Findings into a 66-Endpoint Authorization Overhaul

Why an Aborted Offline Upgrade Still Printed 'Upgrade Successful'

How Python's os.path.exists() dangling-symlink trap, swallowed exit codes, and uncaptured stderr masked a broken upgrade.

Read note →
Why an Aborted Offline Upgrade Still Printed 'Upgrade Successful'

VRRP Multicast Blackhole: 3-Master Split-Brain & 658 Service Restarts

Tracing duplicate virtual IPs and split task queues across a 3-node Linux HA cluster caused by dropped VRRP multicast packets.

Read note →
VRRP Multicast Blackhole: 3-Master Split-Brain & 658 Service Restarts

How an Unbounded K8s CSI Retry Loop Burned 2.4 TiB/Day on System SSDs

Tracing accelerating SSD wear (1.53×) and SMART reserved-block depletion back to 36 stuck Kubernetes PV delete retries.

Read note →
How an Unbounded K8s CSI Retry Loop Burned 2.4 TiB/Day on System SSDs

500 Days Without Compaction: How etcd Hit 8 GiB NOSPACE & Broke DB HA

77.3 million MVCC revisions, two silently dead members, and serialized retries expiring a 10-second master IP lease.

Read note →
500 Days Without Compaction: How etcd Hit 8 GiB NOSPACE & Broke DB HA

Exporting 120M Audit Rows: Cutting Cgroup Memory from 19.5 GB to 223 MB

Eliminating page-cache OOMs with 500k-row streaming shards, byte-level IO, zip -1, and SIGSTOP + fsync + fadvise cache control.

Read note →
Exporting 120M Audit Rows: Cutting Cgroup Memory from 19.5 GB to 223 MB

Why Filtering 32.4M SQLite Rows by Filename Took 160 Seconds

Dissecting leading-wildcard LIKE '%x%' full scans, redundant COUNT(*) queries, and legacy SQLite 3.26 limitations on a 9.7 GiB daily DB.

Read note →
Why Filtering 32.4M SQLite Rows by Filename Took 160 Seconds

How a 0.6s Reboot Race Froze Monitoring for 5 Days—While Showing 'Running'

Uncovering one-shot collector threads dying on boot race and a missing super().__init__() that made every exception log blank.

Read note →
How a 0.6s Reboot Race Froze Monitoring for 5 Days—While Showing 'Running'

Why Production Alerts Arrived 2 Hours Late: 8,886 Timeouts in a FIFO Queue

Using log forensics to prove how a single-threaded downstream webhook receiver stalled an entire FIFO alert pipeline.

Read note →
Why Production Alerts Arrived 2 Hours Late: 8,886 Timeouts in a FIFO Queue

120 Serial SCSI VPD Queries Taking 84.55s: Breaking a 60s Disk-Replace Timeout

Instrumenting each drive-query stage to prove how 120 sequential SCSI VPD calls blew past a 1-minute operation timeout.

Read note →
120 Serial SCSI VPD Queries Taking 84.55s: Breaking a 60s Disk-Replace Timeout

Two Services, One Pair of Ports (80/443): Zero-Touch Split via iptables DNAT

Routing object storage and management UI traffic by destination IP across separate subnets without modifying either application.

Read note →
Two Services, One Pair of Ports (80/443): Zero-Touch Split via iptables DNAT

Catching a 64 KB Silent Truncation in Batch xattr Reads While Exporting 482 Quotas

Why trusting raw batch filesystem APIs silently drops tail records—and how paged reads plus count assertions guarantee integrity.

Read note →
Catching a 64 KB Silent Truncation in Batch xattr Reads While Exporting 482 Quotas

Evidence-Based RCE Triage: Scanning 284 JARs Across 5 Release Lines

Unpacking 27 MB shaded fat JARs for Log4Shell and Text4Shell classes and verifying real runtime preconditions.

Read note →
Evidence-Based RCE Triage: Scanning 284 JARs Across 5 Release Lines

698 Disk Retries & Jumping Volume IDs: Tracing Explorer Freezes to a USB NVMe Bridge

How UASPStor 129 and disk 153 Windows Event Logs eliminated four false suspects and pinpointed an underpowered USB hub.

Read note →
698 Disk Retries & Jumping Volume IDs: Tracing Explorer Freezes to a USB NVMe Bridge

48 GB RAM, 0.08ms NVMe, Yet Explorer Lagged: 32 Injected DLLs & 28 Icon Overlays

Auditing third-party shell injections, ShellIconOverlayIdentifiers overflow (28 vs Windows' 15 limit), and real-time AV contention.

Read note →
48 GB RAM, 0.08ms NVMe, Yet Explorer Lagged: 32 Injected DLLs & 28 Icon Overlays

Say Hello

Always happy to trade war stories, discuss weird Linux/PostgreSQL bugs, or chat about interesting systems engineering problems.