为什么在运行 grpc 的greeter_server.py示例时服务器的内存使用量增加?



我是grpc的新手。然后我刚刚运行了helloword服务器的演示,服务器的驻留内存使用量越来越大。

我在Linux上测试了它,通过pip安装了grpc,grpcio==1.4.0, grpcio-tools==1.4.0,python 2.7.12和3.6.1。

我只在greeter_client.py中添加一行,然后代码如下所示:

def run():
channel = grpc.insecure_channel('localhost:50051')
stub = helloworld_pb2_grpc.GreeterStub(channel)
for i in range(100000):
response = stub.SayHello(helloworld_pb2.HelloRequest(name='you'))
print("Greeter client received: " + response.message)

结果的ps aux链接:

https://user-images.githubusercontent.com/6399856/28417768-e8171cd4-6d8b-11e7-9cf1-817c33641f63.png

我将不胜感激有关此的任何进一步信息,谢谢。

你有没有试过看看这在过去被提出过 https://github.com/grpc/grpc/issues/6619。

经过尝试期,我找到了这个问题的解决方案。 在 grpc 的 github 上应用 djanku 的提交,上面的内存不再增加。

我还希望它将在 grpcio 的下一个发布版本中得到解决。

最新更新