-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Tracking Issue for maxInboundMessageSize being Experimental #2563
Comments
This should include both ManagedChannelBuilder.maxInboundMessageSize and CallOptions.withMaxInboundMessageSize, since the two are closely related. |
As mentioned in #2763:
|
I realized that all the other languages are using "max message size" on the channel. While Netty/OkhttpChannelBuilder had/have maxMessageSize, ManagedChannelBuilder has only had maxInboundMessageSize. I don't want to flip-flop users too much and the "inbound" portion of the name is a more precise, so I think it's fair to stabilize I think there are arguments to have the method on Unfortunately, |
Do you have any plan to make maxMessageSize() part of ServerBuilder? |
Yes. We'd add |
API discussion notes: |
@ejona86 @carl-mastrangelo, is there any config for |
@xin-au can you describe your use case? Generally the server controls how big the message it sends is. The reason it is exposed on the client is to facilitate service config. |
@carl-mastrangelo, I encountered an issue, for the surface, the issue is the client throws some exceptions since the size of a frame it received is larger than 4MB, it is slightly larger, like around 4.4MB. |
How does that solve the problem? Your server would still trying to send too large of a message and gRPC can't take a large message and make it smaller. What's wrong with the current behavior? You have two options: increase the client's maximum message size or have the server send smaller messages. The client change would be configuration in the channel builder. The server change requires changing your service to make smaller messages. |
Thanks @ejona86 for the details! |
@xin-au, gRPC can handle any message size, up to several GB. To protect applications from large memory usage (because a message is atomic; can't be streamed) and encourage services to avoid too-large-of-messages there is functionality to limit the maximum received message size. This limit is applied before decoding a message's bytes into a message object. We also set a default limit of 4 MiB. Anyone can increase the maximum size they are willing to receive via gRPC does split up messages on the transport into smaller chunks. |
@ejona86 Thanks for the details! |
Why? What is to be gained? If you wanted a smaller message, just send a smaller message.
The messages become a stream of bytes and are encoded in HTTP/2's DATA frames. This is sort of similar to using HTTP/1.1 chunked encoding. Many messages can possibly be in a single DATA frame. It's also possible only a portion of a message is in a DATA frame. |
@ejona86 Thanks for your answers! I lack knowledge of how gRPC split up messages. Your answers are helping me. |
No description provided.
The text was updated successfully, but these errors were encountered: