Skip to content

Commit caeb204

Browse files
committed
Add samples/examples for ready-fns
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
1 parent 01e71b6 commit caeb204

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

docs/edge/scale-to-zero.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,21 @@ services:
4141
- probe_interval=100ms
4242
# Max number of probes
4343
- probe_count=20
44-
4544
```
4645

46+
This value gives you around 2s of probing time, which may or may not be enough for your functions. If you start to see failures, simply increase the `probe_count` value to a higher number.
47+
4748
To turn of function probing set `probe_functions=false`.
4849

50+
## Readiness checks for functions
51+
52+
Many times functions need to perform some sort of initialization before they are ready to accept requests.
53+
54+
Set the annotation `com.openfaas.ready.http.path` to point to a custom readiness endpoint on your function.
55+
56+
Then update your handler to return whether the function is ready or not when that custom path i.e. `/ready` is requested.
57+
58+
The following examples show how to implement a readiness endpoint in different languages, each of which has a fake delay built into their start-up process.
59+
60+
See the examples: [https://github.com/alexellis/ready-fns](https://github.com/alexellis/ready-fns)
61+

0 commit comments

Comments
 (0)