Closed FTWH closed 2 years ago
Hi @FTWH thanks for your interest in OpenFaaS
As explained in the blog post and the documentation, retries are part of OpenFaaS Pro. There is no bug or issue here, and everything is working as described.
https://docs.openfaas.com/openfaas-pro/retries/
Here's the docs page that you linked to, it's also shown there quite clearly:
OpenFaaS needs to ensure that all sent asynchronous calls are processed, not just ignored some of them.
No requests are ignored, check the Prometheus metrics and you'll see the 429 responses in the data there. It's just that the Pro solution will retry them, the Community Edition will not and is not intended for commercial exploitation, you can read a comparison here.
If you'd like to talk to us about OpenFaaS Pro, you can do so here: https://openfaas.com/support/
Alex
According to OpenFaaS official doc, when the function concurrent request limit is exceeded (function's max_inflights env variable), the function returns a 429 status code, and the queue worker rather than dropping the message simply submits it back to the queue. But in my experiments, the failed requests will not be retried for processing.
By the way, I have checked https://www.openfaas.com/blog/limits-and-backpressure/ and https://docs.openfaas.com/reference/async/.
Expected Behaviour
I edited deployment for queue-worker and set up env max_inflights:
I set concurrent request limit for a function in a yaml like this:
When bursty async invocations arrived, the function will try its best to handle requests at concurrency under the max_inflights, and all the requests cached in queue-worker will be processed later on.
Current Behaviour
I deploy a simple function that sleeps for 2 seconds at first and then writes a timestamp in Redis DB. I generate workload with hey:
the result was:
but only 10 timestamps were recorded, which means the OpenFaaS only handle 10 requests.
OpenFaaS needs to ensure that all sent asynchronous calls are processed, not just ignored some of them.
Are you a GitHub Sponsor (Yes/No?)
Check at: https://github.com/sponsors/openfaas
Steps to Reproduce (for bugs)
Context
Before we decide to try the paid service of OpenFaaS Pro, we need to ensure the stability of the service. The limit of max_inflights is critical because too large an intra-parallelism can crash the container.
I don't think it's a design flaw, it's possible that the documentation wasn't clear enough to make my configuration wrong.
Your Environment
FaaS-CLI version ( Full output from:
faas-cli version
): 0.14.6Docker version
docker version
(e.g. Docker 17.0.05 ): 20.10.17What version and distriubtion of Kubernetes are you using?
kubectl version
v1.22.0Operating System and version (e.g. Linux, Windows, MacOS): Linux
Link to your project or a code example to reproduce issue:
What network driver are you using and what CIDR? i.e. Weave net / Flannel Flannel