diff --git a/pages/serverless-containers/reference-content/containers-sandbox.mdx b/pages/serverless-containers/reference-content/containers-sandbox.mdx index 22011e7d6c..4d9a2f679e 100644 --- a/pages/serverless-containers/reference-content/containers-sandbox.mdx +++ b/pages/serverless-containers/reference-content/containers-sandbox.mdx @@ -48,3 +48,7 @@ To avoid this, we recommend being cautious when writing temporary files in `/tmp Applications that rely heavily on temporary file storage should either: - Use alternative storage paths within your container - Increase the container's memory allocation to accommodate for temporary file usage + +## Sandbox V2 subprocesses RAM usage + +Sandbox v2 currently does not support copy-on-write when subprocesses are created, which means that the memory usage of a container is proportional to the number of forked subprocesses. If your application relies on multiple subprocesses that instantiate numerous objects, (such as large modules imports in Python) we recommend using Sandbox v1. \ No newline at end of file diff --git a/pages/serverless-containers/troubleshooting/container-uses-too-much-ram.mdx b/pages/serverless-containers/troubleshooting/container-uses-too-much-ram.mdx new file mode 100644 index 0000000000..d913437d9e --- /dev/null +++ b/pages/serverless-containers/troubleshooting/container-uses-too-much-ram.mdx @@ -0,0 +1,22 @@ +--- +title: My container uses too much RAM +description: Troubleshoot issues encountered with Scaleway Serverless Containers consuming excessive amounts of memory. +tags: serverless containers troubleshooting issue error memory ram too much many consumption abnormal high +dates: + validation: 2025-12-19 + posted: 2025-12-19 +--- + +## Problem + +My container consumes an excessive amount of memory (RAM). + +## Possible cause + +With [Sandbox v2](/serverless-containers/reference-content/containers-sandbox/), the memory usage of a container is proportional to the number of forked subprocesses. + +## Solutions + +If your application relies on multiple subprocesses that instantiate numerous objects, (such as large modules imports in Python) we recommend using [Sandbox v1](/serverless-containers/reference-content/containers-sandbox/). + +Refer to the [My container runs out of memory (OOM)](/serverless-containers/troubleshooting/container-oom/) for other solutions for memory issues. \ No newline at end of file diff --git a/pages/serverless-containers/troubleshooting/index.mdx b/pages/serverless-containers/troubleshooting/index.mdx index d9ca11333b..b74eb459e1 100644 --- a/pages/serverless-containers/troubleshooting/index.mdx +++ b/pages/serverless-containers/troubleshooting/index.mdx @@ -72,4 +72,5 @@ productIcon: ContainersProductIcon - [No data show up on Grafana dashboards](/serverless-containers/troubleshooting/no-data-grafana-dashboards/) - [I get errors when using HTTP/1.0](/serverless-containers/troubleshooting/http1-errors/) - [My container runs out of memory](/serverless-containers/troubleshooting/container-oom/) + - [My container uses too much RAM](/serverless-containers/troubleshooting/container-uses-too-much-ram/) diff --git a/pages/serverless-functions/reference-content/functions-sandbox.mdx b/pages/serverless-functions/reference-content/functions-sandbox.mdx index 2097ad7dd5..3eb941c636 100644 --- a/pages/serverless-functions/reference-content/functions-sandbox.mdx +++ b/pages/serverless-functions/reference-content/functions-sandbox.mdx @@ -47,3 +47,7 @@ To avoid this, we recommend being cautious when writing temporary files in `/tmp Applications that rely heavily on temporary file storage should either: - Use alternative storage paths within your function - Increase the function's memory allocation to accommodate for temporary file usage + +## Sandbox V2 subprocesses RAM usage + +Sandbox v2 currently does not support copy-on-write when subprocesses are created, which means that the memory usage of a function is proportional to the number of forked subprocesses. If your application relies on multiple subprocesses that instantiate numerous objects, (such as large modules imports in Python) we recommend using Sandbox v1. \ No newline at end of file diff --git a/pages/serverless-functions/troubleshooting/function-uses-too-much-ram.mdx b/pages/serverless-functions/troubleshooting/function-uses-too-much-ram.mdx new file mode 100644 index 0000000000..0b6ecdc754 --- /dev/null +++ b/pages/serverless-functions/troubleshooting/function-uses-too-much-ram.mdx @@ -0,0 +1,22 @@ +--- +title: My function uses too much RAM +description: Troubleshoot issues encountered with Scaleway Serverless functions consuming excessive amounts of memory. +tags: serverless functions troubleshooting issue error memory ram too much many consumption abnormal high +dates: + validation: 2025-12-19 + posted: 2025-12-19 +--- + +## Problem + +My function consumes an excessive amount of memory (RAM). + +## Possible cause + +With [Sandbox v2](/serverless-functions/reference-content/functions-sandbox/), the memory usage of a function is proportional to the number of forked subprocesses. + +## Solutions + +If your application relies on multiple subprocesses that instantiate numerous objects, (such as large modules imports in Python) we recommend using [Sandbox v1](/serverless-functions/reference-content/functions-sandbox/). + +Refer to the [My function runs out of memory (OOM)](/serverless-functions/troubleshooting/function-oom/) for other solutions for memory issues. \ No newline at end of file diff --git a/pages/serverless-functions/troubleshooting/index.mdx b/pages/serverless-functions/troubleshooting/index.mdx index 2d433c7ffd..d9c40b46e1 100644 --- a/pages/serverless-functions/troubleshooting/index.mdx +++ b/pages/serverless-functions/troubleshooting/index.mdx @@ -70,6 +70,7 @@ productIcon: FunctionsProductIcon - [My function fails after trying too many times](/serverless-functions/troubleshooting/too-many-retries) - [I am experiencing clock drift with my Serverless Functions](/serverless-functions/troubleshooting/function-clock-drift) - [I get errors when using HTTP/1.0](/serverless-functions/troubleshooting/http1-errors/) - - [My function runs out of memory](/serverless-containers/troubleshooting/function-oom/) + - [My function runs out of memory](/serverless-functions/troubleshooting/function-oom/) + - [My function uses too much RAM](/serverless-functions/troubleshooting/function-uses-too-much-ram/)