Project ideas from Hacker News discussions.

Vm.overcommit_memory=2 is the right setting for servers

📝 Discussion Summary (Click to expand)

1. Overcommit is a double‑edged sword – it can kill apps or keep them alive
“Memory overcommit means that once you run out of physical memory, the OOM killer will forcefully terminate your processes with no way to handle the error.”renehsz
“It’s not harmful. It’s necessary for modern systems that are not “an ECU in a car.””PunchyHamster

2. Most production software is written to assume overcommit
“If you turn overcommit off then when you fork you double the memory usage.”loeg
“Disabling overcommit is wasteful because of fork and because of the way thread stacks are allocated.”EdiX

3. Fork/COW and memory accounting make disabling overcommit tricky
“The kernel has to count it as reserved because writes could require allocating memory and that’s not allowed to fail since it’s not a malloc.”pm215
“In mode 2 the MAP_NORESERVE flag is ignored.”laurencerowe

4. Tuning overcommit (ratio, swap, cgroups) is a pragmatic compromise
“The default vm.overcommit_ratio is 50 % which means that if no swap is available, on a system with 2 GB of total RAM, more than 1 GB of RAM can’t be allocated.”vin10
“You can use cgroup resource controls to separately govern max memory and swap usage.”MrDrMcCoy

These four threads capture the core debate: whether overcommit should be enabled, how it affects real‑world workloads, the technical nuances of fork/COW, and the practical knobs that let you balance safety, performance, and resource usage.


🚀 Project Ideas

Overcommit Safety Auditor

Summary

  • A CLI tool that simulates overcommit=2 (vm.overcommit_memory=2) environments using cgroups/ulimits, runs workloads, detects unhandled malloc failures or cryptic crashes, and reports compatibility scores for apps/services.
  • Core value: Enables safe disabling of overcommit without production surprises, quoting kg: "the way stuff fails when it runs out of memory is really confusing and mysterious sometimes."

Details

Key Value
Target Audience DevOps engineers, server admins testing Postgres/Redis-like setups
Core Feature Automated workload replay under memory limits, malloc failure injection, crash analysis with flamegraphs
Tech Stack Rust/Go CLI, libcgrouplite, eBPF for tracing allocations, CRIU for process snapshots
Difficulty Medium
Monetization Revenue-ready: Freemium CLI + SaaS dashboard

Notes

  • HN users like kg and c0l0 would love it for "flushing out issues that would otherwise cause system degradation" without blowing up prod zoos of apps.
  • High discussion potential on kernel tuning; practical for HN's embedded/server hackers.

Preemptive MemShed Daemon

Summary

  • Userspace daemon extending earlyoom/nohang with PSI (pressure stall info) monitoring, cgroup-aware scoring (oom-score-adj + custom heuristics for fork-heavy apps), and proactive throttling/kills before thrashing.
  • Core value: Prevents OOM slowness, quoting PunchyHamster: "software like earlyoom... tried to preempt oomkiller and kill something before it gets to sluggish state"; webstrand praises multi-gen LRU + nohang.

Details

Key Value
Target Audience Linux server operators, container hosts (Kubernetes nodes)
Core Feature Real-time PSI/cgroup stats polling, ML-based hog prediction, webhook alerts/auto-restarts
Tech Stack Go daemon, eBPF for PSI, systemd integration, Prometheus exporter
Difficulty Medium
Monetization Hobby

Notes

  • Addresses silon42's desktop thrashing ("left it overnight... not always recovered") and Tuna-Fish's cgroup OOM prefs; HN would debate heuristics.
  • Immediate utility for prod, sparks threads on PSI vs. traditional OOM.

ForkImpact Simulator

Summary

  • Tool modeling fork() COW memory commitment under overcommit=2, scanning processes for fork patterns (e.g., Redis snapshots), predicting peak commit spikes, and suggesting mitigations like overcommit_ratio tweaks or alternatives.
  • Core value: Quantifies "waste" debates, quoting PunchyHamster's Apache example ("50MB + (50MB * 32)"); toast0: "doubles your memory commit" for Redis.

Details

Key Value
Target Audience Database admins (Redis/Postgres), app devs using fork
Core Feature Live /proc scanning + simulation of fork chains, commit ratio optimizer, THP warnings
Tech Stack Python CLI, ptrace for process introspection, matplotlib for spike graphs
Difficulty Low
Monetization Revenue-ready: Open-source + paid cloud scanner

Notes

  • Directly tackles jcalvinowens/PunchyHamster RAM waste ("wasted if apps don't use disk"); loeg/kibwen fork accounting confusion.
  • HN fork nerds would fork it; useful for "philosophical" workloads like inkyoto's daemon examples.

Read Later