Start a grpc server on a remote machine

156 views
Skip to first unread message

m...@zenprospect.com

unread,
Aug 30, 2016, 8:11:19 PM8/30/16
to grpc.io
I read from the tutorial that "server.start() does not block you may need to sleep-loop if there is nothing else for your code to do while serving." Is the recommended approach to include the following code after server.start()?
  try:
    while True:
      time.sleep(60*60*24)
  except KeyboardInterrupt:
    server.stop(0)

If I'm setting up a grpc service on a remote machine, I can ssh into the machine and run command like "python3 server.py" to start the server. How can I keep the service running if I want to exit ssh from my local machine?

Mark NS

unread,
Aug 31, 2016, 4:14:54 AM8/31/16
to grpc.io, m...@zenprospect.com

m...@zenprospect.com

unread,
Aug 31, 2016, 12:30:43 PM8/31/16
to grpc.io, m...@zenprospect.com
Thanks Mark! I ended up setting up uWSGI and Enginx.

gyang....@gmail.com

unread,
Jul 17, 2017, 5:05:59 PM7/17/17
to grpc.io, m...@zenprospect.com
Hi, M. from zenpropect,

I am looking for a solution to serve gRPC using uWSGI and Nginx.

Would you mind to give an overview of how you did it?

Thanks in advance.

Best Regards,
Guang Yang
Reply all
Reply to author
Forward
0 new messages