Why My MongoDB Container Refused to Restart (Hint: Check Your Disk)

My MongoDB container wouldn’t restart. No matter what I tried, Docker just threw this back at me: Cannot restart container sudden-mongodb: mkdir /mnt/.../overlay2/.../merged: no space left on device Here’s how I diagnosed it, fixed it, and made sure it won’t happen again. The Symptoms The container was technically “running” but stuck in health: starting status. Docker’s health check kept returning results, but MongoDB itself was in a crash loop. Every restart attempt failed with the same no space left on device error. ...

March 20, 2026 · Deeka

Understanding Memory Usage of Numbers and Strings in MongoDB

In MongoDB, the memory size of data types like Number and String varies depending on the specific type and content. Here’s a simplified breakdown: Number Data Types: Double (64-bit floating-point): 8 bytes. 32-bit Integer (int): 4 bytes. 64-bit Integer (long): 8 bytes. Decimal128 (high-precision): 16 bytes. String Data Type: Memory Size: Depends on the length of the string in UTF-8 encoding. Formula: (Number of UTF-8 characters) + 1 byte for a null terminator + 4 bytes for overhead. For example, the string “hello” would require 10 bytes in total. ...

September 24, 2024 · Deeka