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

Conditionalize MaxRecvMessageSize #40

Open
vibe opened this issue Sep 25, 2024 · 5 comments
Open

Conditionalize MaxRecvMessageSize #40

vibe opened this issue Sep 25, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@vibe
Copy link

vibe commented Sep 25, 2024

There was a need to bump MaxRecvMessageSize across all our functions recently with the upgrade to the new v1 sdk, this included function-auto-ready.

Just dropping an issue to track this, and get some feedback about where the best place to implement this is.

Simple fix is to update the fn.Serve with function.MaxRecvMessageSize(c.MaxGRPCMessageSize).

Could either happen at each function level, or function-sdk-go template.

@vibe vibe added the enhancement New feature or request label Sep 25, 2024
@jbw976
Copy link
Member

jbw976 commented Sep 25, 2024

Would you be able to add a bit more detail on what the problem is here @vibe? I don't fully understand the scope and impact just yet 🤔

@vibe
Copy link
Author

vibe commented Sep 30, 2024

Would you be able to add a bit more detail on what the problem is here @vibe? I don't fully understand the scope and impact just yet 🤔

Sure @jbw976.

Essentially, in Go's gRPC library, the default maximum received message size is 4MB. So messages sent between composition functions need to be remain under this limit, since this includes the observed composite resource and the desiresd resources, this message size can increase as more resources are being generated by a composition pipeline.

A few months ago we hit the 4MB limit (our composition, provisions large amounts of EC2 with custom user data), we then refactored the user data so that the total size would fall below 4MB.

Fast forward to last week: We bumped our function-sdk-go to 0.3.0 and the message size between our composition increased resulting in an error along the lines of received message larger than max (420000 vs. 4194304)". Rolling back the function-sdk-go lowered the message size.

We were easily able to update our own function's MaxRecvMessageSize but not function-auto-ready so we had to fork it and make the change.

It makes sense function-template-go is updated, along with any other functions that may need this change.

I can work on a PR soon.

@fernandezcuesta
Copy link

fernandezcuesta commented Nov 4, 2024

Yeah here we faced the same issue, which surfaced with function-auto-ready, since that's the last in the pipeline and we've quite a fat composition. It would be nice to be able to tune the max size from an env var for example.

@fnicolelli-ls
Copy link

Hi team, same issue here we hit the limit in function-auto-ready since we have a quite big composition that unfortunately cannot be split.
It would be awesome have the possibility to set the max size.
Thanks!

@vibe
Copy link
Author

vibe commented Nov 20, 2024

Sorry, finally go around to this.

crossplane/function-template-go#91
#47

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

No branches or pull requests

4 participants