【问题标题】:Increasing GRPC message size is not working增加 GRPC 消息大小不起作用
【发布时间】:2021-11-14 19:22:34
【问题描述】:

我正在发送超过 40 MB 的 grpc 消息,我已将客户端和服务器端的 grpc 消息大小限制设置如下,以占用 64 MB 仍然收到大小限制错误?

客户

options = [('grpc.max_send_message_length', 64*1024*1024),
                       ('grpc.max_receive_message_length', 64*1024*1024)]
channel = grpc.secure_channel(channel_endpoint, grpc.ssl_channel_credentials(), options)

服务器

choptions = [('grpc.max_send_message_length', 64*1024*1024),
                ('grpc.max_receive_message_length', 64*1024*1024)]
server = grpc.server(futures.ThreadPoolExecutor(max_workers=max_workers), options=choptions)

遇到错误:

status = StatusCode.RESOURCE_EXHAUSTED
details = "grpc: received message larger than max (4718167 vs. 4194304)

如何解决这个问题?

【问题讨论】:

    标签: python-3.x grpc grpc-python


    【解决方案1】:

    从错误消息来看,它看起来来自 Go 服务器而不是 Python 服务器 https://github.com/grpc/grpc-go/blob/670c133e568e89c901d05b898af9f5ce72a88c6d/rpc_util.go#L573,而不是来自 Python 服务器的错误 - https://github.com/grpc/grpc/blob/6b916984a8b167d4bcf9c15e21090be49976ceaa/src/core/ext/filters/message_size/message_size_filter.cc#L206

    要解决此问题,您还需要提高 Go 服务器的限制。

    【讨论】:

      猜你喜欢
      • 2017-07-26
      • 1970-01-01
      • 1970-01-01
      • 2015-02-03
      • 1970-01-01
      • 2018-07-29
      • 1970-01-01
      • 2023-01-24
      • 1970-01-01
      相关资源
      最近更新 更多