openfaas / faas

OpenFaaS - Serverless Functions Made Simple
https://www.openfaas.com
MIT License
24.75k stars 1.92k forks source link

Empty response when payload is bigger than 1MB #1794

Closed lapwat closed 1 year ago

lapwat commented 1 year ago

My actions before raising this issue

Why do you need this?

I am trying to get a response back from my function.

Who is this for?

What company is this for? Are you listed in the ADOPTERS.md file? No

Expected Behaviour

I would like to be able to get an answer from the function even if the payload is bigger than 1MB.

Current Behaviour

I have the following error message:

Can't reach service: xxx

When the response size of my serverless function is bigger than 1MB.

Are you a GitHub Sponsor (Yes/No?)

Check at: https://github.com/sponsors/openfaas

List All Possible Solutions and Workarounds

Is there a way to increase the 1MB nats limit from Openfaas Helm Chart ?

Context

If the response payload is under 1MB it works well.

If I build and run the function locally with docker run it works well.

I think that the problem might come from the NATS payload size limit referenced here

https://docs.openfaas.com/reference/async/#configuration-limits

Logs

2023/05/11 14:14:48 Forking fprocess.
2023/05/11 14:14:49 Wrote 3753 Bytes - Duration: 0.660251s ==> SUCCESS
2023/05/11 14:16:16 Forking fprocess.
2023/05/11 14:16:19 Wrote 1560412 Bytes - Duration: 2.905908s ==> FAILED with `Can't reach service`

Your Environment

OpenFaaS on Kubernetes installed with Helm Chart

alexellis commented 1 year ago

Hi @lapwat sounds like you have a misconfiguration in your timeouts.

The config-checker will show you that:

https://github.com/openfaas/config-checker

Or you can just follow this tutorial if you're on K8s:

https://docs.openfaas.com/tutorials/expanded-timeouts/

alexellis commented 1 year ago

In future, we can answer questions better when people give us steps to reproduce a problem. You didn't do that, so we weren't able to help you as much as you may have needed.

Alex