How a misconfigured 1.6 GB VPS froze for hours due to npm ci memory exhaustion
A developer's low-spec VPS running a static sleep-cycle calculator crashed twice in September — first for 10 hours on the 18th, then for 4 hours two days later — due to memory exhaustion triggered by running npm ci during deployments. Kernel logs confirmed the OOM killer terminated the npm process, which had consumed around 600 MB of real RAM on a machine with only 1,612 MB available and zero swap space configured. The combination of no swap and a vm.swappiness setting of 0 left the kernel no fallback mechanism, causing prolonged thrashing rather than a quick process kill. The developer resolved the issue by adding a 4 GB swapfile, adjusting vm.swappiness to 10, and installing earlyoom to trigger faster OOM kills before the system fully freezes. The post-mortem highlights that disabling swap entirely on memory-constrained servers can be more dangerous than the performance overhead it aims to avoid.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in