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

gRPC throws error on large input size #942

Closed
ankita4AI opened this issue Jan 19, 2021 · 9 comments · Fixed by #979
Closed

gRPC throws error on large input size #942

ankita4AI opened this issue Jan 19, 2021 · 9 comments · Fixed by #979
Assignees
Labels
good first issue Good for newcomers triaged_wait Waiting for the Reporter's resp
Milestone

Comments

@ankita4AI
Copy link

ankita4AI commented Jan 19, 2021

Hello,
gRPC throws an error when the size of input request is bulky, which is not the case with REST requests.
works seamlessly for smaller batch sizes.
Where am I supposed to increase max size parameter?

PFB the error log
debug_error_string = "{"created":"@1611067667.277075000","description":"Error received from peer ipv6:[::1]:7070","file":"src/core/lib/surface/call.cc","file_line":1063,"grpc_message":"Received RST_STREAM with error code 8","grpc_status":1}"

Any help would be appreciated.
TIA

@maaquib
Copy link
Collaborator

maaquib commented Jan 19, 2021

@ankita4AI Can you try increasing max_request_size parameter to something larger (doc)

@maaquib maaquib self-assigned this Jan 19, 2021
@maaquib maaquib added the triaged_wait Waiting for the Reporter's resp label Jan 19, 2021
@ankita4AI
Copy link
Author

hi @maaquib thanks for your response.
But this max_request_size in ConfigManager.java is not the one overriding grpc's message size.
I wonder where grpc client settings are configured. can you point me where we can set max message Inbound size for gRPC.
I can say that with certainty coz its maximum size remains 4194304 no matter the max_request_size set.

please find below ts_logs for more information
WARNING: Exception processing message
io.grpc.StatusRuntimeException: RESOURCE_EXHAUSTED: gRPC message exceeds maximum size 4194304: 9198552

@ankita4AI
Copy link
Author

ankita4AI commented Jan 20, 2021

gRPC uses per-message size limits to manage incoming and outgoing messages. By default, gRPC limits incoming messages to 4 MB. There is no limit on outgoing messages.
I tried updating the grpc client file where we set the channel, but I see the same error.

def get_inference_stub():
    channel = grpc.insecure_channel(
    'localhost:7070',
    options=[
        ('grpc.max_send_message_length', 15000000),
        ('grpc.max_receive_message_length', 15000000),
    ],
    )
    stub = inference_pb2_grpc.InferenceAPIsServiceStub(channel)
    return stub

@maaquib
Copy link
Collaborator

maaquib commented Jan 22, 2021

Looks like this has to be made configurable on the server side by adding this parameter. Adding this to 0.4 roadmap

@ankita4AI
Copy link
Author

I was trying to update startGRPCServer method in ModelServer.java
one can update ServerBuilder's setMaxMessageSize to unlimited.
But struggled at rebuilding torch serve for this build to be used.
Please share steps to do that as well, It would help a lot, Thanks.

@maaquib
Copy link
Collaborator

maaquib commented Jan 22, 2021

@ankita4AI You can run the scripts here to build TS from source.

@cbasavaraj
Copy link

Hi, I tried changing client side code just like @ankita4AI . Can confirm that it's not enough. Looking forward to server side changes in v0.4. Thanks

@maaquib maaquib added this to the v0.4.0 milestone Feb 2, 2021
@maaquib maaquib added the good first issue Good for newcomers label Feb 2, 2021
@lxning lxning linked a pull request Feb 24, 2021 that will close this issue
9 tasks
@cbasavaraj
Copy link

Hi, will v0.4.0 be released sometime soon? Thanks

@lxning
Copy link
Collaborator

lxning commented Apr 16, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers triaged_wait Waiting for the Reporter's resp
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants