Skip to content

Commit 93039c9

Browse files
committed
docs(srv): add tb on tmpfs-related oom issues
1 parent 12a1acc commit 93039c9

File tree

3 files changed

+51
-0
lines changed

3 files changed

+51
-0
lines changed

pages/serverless-containers/reference-content/containers-sandbox.mdx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,27 @@ Sandbox v1 is known to experience clock drift over time. A difference of approxi
2525
## Sandbox v2
2626

2727
Sandbox v2 is a modern isolation environment that relies on [gVisor](https://gvisor.dev/). This option offers faster [cold starts](/serverless-containers/concepts/#cold-start), but only implements a selection of Linux syscalls.
28+
2829
Refer to the [official gVisor documentation](https://gvisor.dev/docs/user_guide/compatibility/linux/amd64/) for a comprehensive list of supported syscalls.
30+
31+
## Sandbox special directories
32+
33+
In sandbox v1 and v2, some directories are mounted as `tmpfs` for temporary in-memory storage:
34+
35+
| Sandbox v1 |Sandbox v2 |
36+
|---|---|
37+
| /dev (max size: 65 536 KB) | /dev (no max size)|
38+
| | /tmp (no max size) |
39+
40+
In Sandbox v1, the size is limited, and its impact on memory usage is negligible.
41+
42+
In Sandbox v2, directories such as `/tmp` and `/dev` are stored in memory. This means that any data written to `/tmp` consumes RAM directly. For example, writing a 100 MB file to `/tmp` will increase the container’s memory usage by the same amount.
43+
44+
Since this usage counts toward the container’s memory limit, excessive writes to `/tmp` can lead to out-of-memory (OOM) errors, potentially triggering a container restart.
45+
46+
To avoid this, we recommend being cautious when writing temporary files in `/tmp`, especially in long-running or high-throughput workloads.
47+
48+
Applications that rely heavily on temporary file storage should either:
49+
- Use alternative storage paths within your container
50+
- Increase the container’s memory allocation to accommodate for temporary file usage
51+
- Use ephemeral storage
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
title: My container runs out of memory (OOM)
3+
description: Troubleshoot issues encountered with Scaleway Serverless Containers running out of memory and restarting.
4+
tags: serverless containers troubleshooting issue error memory ram oom restart crash freeze bsod
5+
dates:
6+
validation: 2025-12-03
7+
posted: 2025-12-03
8+
---
9+
10+
## Problem
11+
12+
My container runs out of memory (OOM) and crashes or restarts.
13+
14+
## Possible cause
15+
16+
In sandbox v1 and v2, some directories are mounted as `tmpfs` for temporary in-memory storage. In Sandbox v2, directories such as `/tmp` and `/dev` are stored in memory.
17+
18+
Excessive writes to `/tmp` can fill up the provisioned memory, leading to out-of-memory (OOM) errors, potentially triggering a container restart.
19+
20+
## Solutions
21+
22+
- Avoid writing temporary files in `/tmp`.
23+
- Use alternative storage paths within your container
24+
- Increase the container’s memory allocation to accommodate for temporary file usage
25+
- Use ephemeral storage
26+
27+
Refer to the [dedicated documentation](/serverless-containers/reference-content/containers-sandbox/) for more information on Sandboxes.

pages/serverless-containers/troubleshooting/index.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,5 @@ productIcon: ContainersProductIcon
7171
- [I cannot access my container](/serverless-containers/troubleshooting/cannot-access-container/)
7272
- [No data show up on Grafana dashboards](/serverless-containers/troubleshooting/no-data-grafana-dashboards/)
7373
- [I get errors when using HTTP/1.0](/serverless-containers/troubleshooting/http1-errors/)
74+
- [My container runs out of memory](/serverless-containers/troubleshooting/container-oom/)
7475
</LinksList>

0 commit comments

Comments
 (0)