journal of recreational computer science

home

Increasing gRPC maximum message size (in Python)

26 Apr 2018

This is parked here for my future reference.

Problem statement: By default gRPC will accept RPC message up to four megabytes in size. If you need to send anything bigger, you will need to tweak some settings. There are two options which can be adjusted when creating a new server. This changes both the max incoming and outgoing message size to 1 gigabyte:

gigabyte = 1024 ** 3

executor = futures.ThreadPoolExecutor()
server = grpc.server(executor, options=[
  ('grpc.max_send_message_length', gigabyte),
  ('grpc.max_receive_message_length', gigabyte)
])

comments powered by Disqus