Skip to content

Commit 74f14e4

Browse files
weltekialexellis
authored andcommitted
Add note on resource constraints for OpenFaaS Edge
Signed-off-by: Han Verstraete (OpenFaaS Ltd) <[email protected]>
1 parent 0a2aad8 commit 74f14e4

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

docs/edge/overview.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Most of the [OpenFaaS Pro documentation](/docs/openfaas-pro/) and [Helm charts](
1616
* [Improve container security with gVisor](/edge/gvisor)
1717
* [OpenTelemetry](/edge/open-telemetry)
1818
* [Air Gap](/edge/airgap)
19+
* [Resource constraints](/reference/yaml/#function-memorycpu-limits)
1920

2021
## Looking for something else?
2122

docs/reference/yaml.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -319,10 +319,20 @@ Example of setting a custom HTTP health check path and initial check delay:
319319

320320
Applying memory and CPU limits can be done through the `limits` and `requests` [fields](https://godoc.org/github.com/openfaas/faas-cli/stack#FunctionResources). It is advisable to always set a limit for your functions to prevent them consuming too many resources in your system.
321321

322-
> Important note: The value for memory for Kubernetes needs to be in the format "Mi".
322+
When using OpenFaaS on Kubernetes:
323+
324+
- Requests ensure the stated host resource is available for the container to use.
325+
- Limits specify the maximum amount of host resources that a container can consume.
326+
327+
On OpenFaaS Edge:
328+
329+
- Limits specify the maximum amount of host resources that a container can consume.
330+
- Setting requests is not supported. Any requests set on functions will be ignored.
323331

324332
Here we constrain the url-ping function to only use 40Mb of RAM at a maximum.
325333

334+
> Important note: The value for memory for Kubernetes needs to be in the format "Mi".
335+
326336
```YAML
327337
url-ping:
328338
lang: python
@@ -347,11 +357,6 @@ Here we constrain a function to use only `100m` which is equivalent to 1/10 of [
347357
cpu: 100m
348358
```
349359

350-
The meanings and formats of `limits` and `requests` may vary depending on whether you are using Kubernetes or Docker Swarm. In general:
351-
352-
- Requests ensures the stated host resource is available for the container to use
353-
- Limits specify the maximum amount of host resources that a container can consume
354-
355360
Read more for: [Kubernetes](https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#how-pods-with-resource-limits-are-run).
356361

357362
## Configuration

0 commit comments

Comments
 (0)