You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds section on async / parallel processing to the trouble-
shooting guide
Adds section to the auto-scaling doc
Signed-off-by: Alex Ellis (VMware) <[email protected]>
Copy file name to clipboardExpand all lines: docs/architecture/autoscaling.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,14 +4,16 @@ Auto-scaling in OpenFaaS allows a function to scale up or down depending on dema
4
4
5
5
## Scaling by requests per second
6
6
7
-
OpenFaaS ships with a single auto-scaling rule defined in the configuration for AlertManager. AlertManager reads usage (requests per second) metrics from Prometheus in order to know when to fire an alert to the API Gateway.
7
+
OpenFaaS ships with a single auto-scaling rule defined in the mounted configuration file for AlertManager. AlertManager reads usage (requests per second) metrics from Prometheus in order to know when to fire an alert to the API Gateway.
8
8
9
9
The API Gateway handles AlertManager alerts through its `/system/alert` route.
10
10
11
11
The auto-scaling provided by this method can be disabled by either deleting the AlertManager deployment or by scaling the deployment to zero replicas.
12
12
13
13
The AlertManager rules ([alert.rules](https://github.com/openfaas/faas/blob/master/prometheus/alert.rules.yml)) for Swarm can be viewed here and altered as a configuration map.
14
14
15
+
All calls made through the gateway whether to a synchronous function `/function/` route or via the asynchronous `/async-function` route count towards this method of auto-scaling.
16
+
15
17
### Min/max replicas
16
18
17
19
The minimum (initial) and maximum replica count can be set at deployment time by adding a label to the function.
Copy file name to clipboardExpand all lines: docs/deployment/troubleshooting.md
+20Lines changed: 20 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,25 @@
1
1
# Troubleshooting guide
2
2
3
+
## Asynchronous functions
4
+
5
+
Any function can be invoked asynchronously by changing the route on the gateway from `/function/<name>` to `/async-function/<name>`. A `202 Accepted` message will be issued in response to asynchronous calls.
6
+
7
+
If you would like to receive a value from an asynchronous call you should pass a HTTP header with the URL to be used for the call-back.
Alternatively you can specify another asynchronous or synchronous function to run instead.
14
+
15
+
* Parallelism
16
+
17
+
By default there is one queue-worker replica deployed which is set up to run a single task of up to 30 seconds in duration with one task in parallel. You can increase the parallelism by scaling the queue-worker up - i.e. 5 replicas for 5 parallel tasks.
18
+
19
+
You can tune the values for the number of tasks each queue worker may run in parallel as well as the maximum duration of any asynchronous task that worker processes. Edit the Kubernetes helm chart, YAML or Swarm docker-compose.yml files.
20
+
21
+
The [OpenFaaS workshop](https://github.com/openfaas/workshop) has more instructions on running tasks asynchronously.
22
+
3
23
## Timeouts
4
24
5
25
Default timeouts are configured at the HTTP level and must be set both on the gateway and the function.
0 commit comments