What is `shm_size` and when is it needed?
AdvancedProductionResource Limits, Health & Reliability
Answer
/dev/shm defaults to 64 MB in containers. Chrome/Playwright and PostgreSQL parallel queries crash or fail ("could not resize shared memory segment", "Aw, Snap!") with that. Set --shm-size=1g or Compose shm_size: 1gb, or --ipc=host for Chrome (less isolated).
More on Resource Limits, Health & Reliability
How do you set memory and CPU limits, and what happens when they are exceeded?BeginnerWhat is the difference between `--cpus`, `--cpu-shares` and `--cpuset-cpus`?BeginnerWhat does `--memory-reservation` do?AdvancedHow do you diagnose an OOM-killed container?IntermediateWhy do JVM and Node services in containers need explicit memory flags?IntermediateWhat is CPU throttling, and how do you detect it?Advanced