Skip to content
Permalink
Browse files

fix(service): fix grpc server size limit

  • Loading branch information...
Larryjianfeng committed Jul 15, 2019
1 parent dd09155 commit 09e68da21ca578ca28b62a179edc798343a42205
Showing with 7 additions and 1 deletion.
  1. +4 −0 gnes/cli/parser.py
  2. +3 −1 gnes/service/grpc.py
@@ -161,6 +161,10 @@ def set_grpc_frontend_parser(parser=None):
_set_grpc_parser(parser)
parser.add_argument('--max_concurrency', type=int, default=10,
help='maximum concurrent client allowed')
parser.add_argument('--max_send_size', type=int, default=100,
help='maximum send size for grpc server in (M)')
parser.add_argument('--max_receive_size', type=int, default=100,
help='maximum receive size for grpc server in (M)')
return parser


@@ -134,7 +134,9 @@ class GRPCFrontend:
def __init__(self, args):
self.logger = set_logger(self.__class__.__name__, args.verbose)
self.server = grpc.server(
futures.ThreadPoolExecutor(max_workers=args.max_concurrency))
futures.ThreadPoolExecutor(max_workers=args.max_concurrency),
options=[('grpc.max_send_message_length', args.max_send_size*1024*1024,
'grpc.max_receive_message_length', args.max_receive_size*1024*1024)])
self.logger.info('start a grpc server with %d workers' % args.max_concurrency)
gnes_pb2_grpc.add_GnesRPCServicer_to_server(GNESServicer(args), self.server)

0 comments on commit 09e68da

Please sign in to comment.
You can’t perform that action at this time.