Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for streaming? #299

Open
kmulka-bloomberg opened this issue Jul 21, 2023 · 3 comments
Open

Support for streaming? #299

kmulka-bloomberg opened this issue Jul 21, 2023 · 3 comments

Comments

@kmulka-bloomberg
Copy link

Is there any support for streaming response output? Like websockets, server-sent events, or similar?

@rdettai
Copy link

rdettai commented Oct 17, 2023

Just to provide a bit more context to @kmulka-bloomberg's question, response streaming is supported by lambda since mid 2023: https://aws.amazon.com/blogs/compute/introducing-aws-lambda-response-streaming/

@pkit
Copy link

pkit commented Nov 2, 2023

@rdettai response streaming is supported with NodeJS runtime only, according to your link. :)
And upping the size from 6MB to 20MB looks hilarious.

@rdettai
Copy link

rdettai commented Nov 6, 2023

response streaming is supported with NodeJS runtime only

You're right! At the time they released the feature they only added support for it in the Node runtime. Pretty weird! It is supported in other SDKs now, such as Rust. It should also be doable in Python but strangely I couldn't find any reference about that.

upping the size from 6MB to 20MB looks hilarious

Yes, pushing the limit a few megabytes further is only a minor improvements on that front as you'll probably still need some sort of offloading through S3 for larger responses anyway. Note that the 20MB limit is a soft limit (at least when your not running through API Gateway). It means you can increase it by contacting the support. But it's probably not a very good idea as payloads above 6MB are throttled to 2MBps.

Note that the benefit of having a streamed response is not just for transferring larger payloads, it's also interesting to

  • reduce "time to first byte"
  • some exotic workloads, e.g a Lambda that performs highly selective search across a massive dataset: you might be interested to get the search results as they come in to have a more interactive UI on the caller side (again, not compatible with API Gateway 😢)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants