Skip to content

Commit 045e9eb

Browse files
weltekialexellis
authored andcommitted
Add notes on function probing for scale from zero
Signed-off-by: Han Verstraete (OpenFaaS Ltd) <[email protected]>
1 parent d0cf404 commit 045e9eb

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

docs/edge/scale-to-zero.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,28 @@ The global idle period can be adjusted by editing the `faas-idler` section of `/
2121
- "write_debug=false"
2222
```
2323
24+
## Scaling up from zero
25+
26+
Functions are automatically scaled up from zero when there is a request. By default the OpenFaaS gateway probes the function ready endpoint to know if a function is ready to start accepting requests before forwarding the request.
27+
28+
The watchdog implements the default ready endpoint `/_/ready`. You can override the endpoint by setting the annotation `com.openfaas.ready.http.path` on the function. A custom ready endpoint can be used if you have a function that is slow to start.
29+
30+
!!! note "Scale from zero with gVisor"
31+
32+
Some languages, like NodeJS, take longer to initialize when using the gVisor runsc runtime. The watchdog reports ready while the function process is still initializing. It is recommended to implement and configure a custom readiness endpoint on the function.
33+
34+
To extend the probing duration adjust the global probing configuration by editing the `gateway` section of `/var/lib/faasd/docker-compose.yaml`
35+
36+
```yaml
37+
services:
38+
gateway:
39+
environment:
40+
# The interval between probes
41+
- probe_interval=100ms
42+
# Max number of probes
43+
- probe_count=20
44+
45+
```
46+
47+
To turn of function probing set `probe_functions=false`.
48+

0 commit comments

Comments
 (0)