mirror of
https://github.com/openfaas/faas.git
synced 2025-06-09 16:56:47 +00:00
Mention Afterburn update
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
This commit is contained in:
parent
922923d138
commit
4c17ccf662
@ -84,7 +84,21 @@ The watchdog can be configured through environmental variables. You must always
|
||||
|
||||
## Advanced / tuning
|
||||
|
||||
**Working with HTTP headers**
|
||||
### of-watchdog and AfterBurn
|
||||
|
||||
* of-watchdog
|
||||
|
||||
A new version of the watchdog is being tested over at [openfaas-incubator/of-watchdog](https://github.com/openfaas-incubator/of-watchdog).
|
||||
|
||||
This re-write is mainly structural for on-going maintenance. It will be a drop-in replacement for the existing watchdog and also has binary releases available.
|
||||
|
||||
* AfterBurn Optimizations
|
||||
|
||||
Forking a new process per request has many advantages for isolation, simplicity and means any process can be a function without any additional code. AfterBurn is an optimization which maintains one single process between all requests and means a Java function can execute a round-trip in as little as 10-12ms without further tuning. It relies on a simple client library maintained by this project for each runtime language.
|
||||
|
||||
You can read about [AfterBurn](https://blog.alexellis.io/openfaas-serverless-acceleration/) on my blog. It is supported by the of-watchdog and a version is also available for the existing watchdog in [PR #224](https://github.com/openfaas/faas/pull/224).
|
||||
|
||||
### Working with HTTP headers
|
||||
|
||||
Headers and other request information are injected into environmental variables in the following format:
|
||||
|
||||
@ -132,7 +146,7 @@ Http_Query=action=quote&qty=1&productId=105
|
||||
|
||||
You can now use HTTP state from within your application to make decisions.
|
||||
|
||||
**HTTP methods**
|
||||
### HTTP methods
|
||||
|
||||
The HTTP methods supported for the watchdog are:
|
||||
|
||||
@ -144,7 +158,7 @@ Without a body:
|
||||
|
||||
> The API Gateway currently supports the POST route for functions.
|
||||
|
||||
**Content-Type of request/response**
|
||||
### Content-Type of request/response
|
||||
|
||||
By default the watchdog will match the response of your function to the "Content-Type" of the client.
|
||||
|
||||
@ -153,11 +167,11 @@ By default the watchdog will match the response of your function to the "Content
|
||||
|
||||
To override the Content-Type of all your responses set the `content_type` environmental variable.
|
||||
|
||||
**I don't want to use the watchdog**
|
||||
### I don't want to use the watchdog
|
||||
|
||||
This is an unsupported use-case for the OpenFaaS project however if your container exposes HTTP POST on port 8080 then the OpenFaaS API gateway and other tooling will manage your container.
|
||||
|
||||
**Tuning auto-scaling**
|
||||
### Tuning auto-scaling
|
||||
|
||||
Auto-scaling starts at 1 replica and steps up in blocks of 5:
|
||||
|
||||
@ -172,4 +186,6 @@ You can override the upper limit of auto-scaling by setting the following label
|
||||
com.faas.max_replicas: "10"
|
||||
```
|
||||
|
||||
If you want to disable scaling, set the `com.faas.max_replicas` value to `"1"`.
|
||||
In Docker Swarm you can disable scaling, set the `com.faas.max_replicas` value to `"1"`.
|
||||
|
||||
As an alternative you can also remove or scale AlertManager to zero replicas.
|
Loading…
x
Reference in New Issue
Block a user