Hi,
I have a gRPC service running fine on a server. I have limited amount of
servers so what I want to do is run this service on the same server but on
different ports (basically faking the number of grpc servers). The service
has a single rpc which sends data every 1 second.
I am running this service on 100 different ports staring from 50000 to
50100. Now there are 100 different clients making requests to their
corresponding server. What I noticed is the data is not sent by these
servers every 1 second.
Example:
Servers are running on localhost:50000, localhost:50001, localhost:50002
.... localhost:50100
class OpenConfigServicer(plugin_pb2_grpc.OpenConfigServicer):
def dataSubscribe(self, request, context):
# this rpc yields data every 1s
def serve():
servers = []
for i in range(50000, 50101):
server = grpc.server(futures.ThreadPoolExecutor(max_workers=1))
servers.append(server)
i = 50000
for server in servers:
plugin_pb2_grpc.add_OpenConfigServicer_to_server(
OpenConfigServicer(), server)
server.add_insecure_port('[::]:' + str(i))
server.start()
i += 1
Can someone tell me if we can optimize this
Thanks,
Ranjith
--
You received this message because you are subscribed to the Google Groups
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit
https://groups.google.com/d/msgid/grpc-io/16dd8db6-0b92-47c4-8ecd-018e604ac79c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.