Load balancing gRPC servers

1,983 views
Skip to first unread message

jdov...@gmail.com

unread,
Jul 27, 2016, 9:01:03 PM7/27/16
to grpc.io
In the past I've used haproxy to load balance all sorts of things.

I would imagine a TCP based load balancing would be sufficient to ensure high availability.

Has anyone tried this or has any advice on this matter?

TIA

Eric Anderson

unread,
Jul 28, 2016, 1:54:27 PM7/28/16
to jdov...@gmail.com, grpc.io
Both TCP-based LB and HTTP/2-based LB (with HTTP/2 to the backend) work as expected. TCP-based does not work as well with HTTP/2 because the connections last longer than HTTP/1, but it does function.

--
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 grpc-io+unsubscribe@googlegroups.com.
To post to this group, send email to grp...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/dcd3ca0f-3771-4521-bc44-99068086e848%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

jdov...@gmail.com

unread,
Jul 28, 2016, 5:52:59 PM7/28/16
to grpc.io, jdov...@gmail.com
Thanks. 

It seem Nginx v1.9.5 supports HTTP/2

It's not clear what the state of HTTP/2 support is in HAProxy though they did say they were going to add it.

Eric Anderson

unread,
Jul 29, 2016, 1:11:47 PM7/29/16
to jdov...@gmail.com, grpc.io
On Thu, Jul 28, 2016 at 2:52 PM, <jdov...@gmail.com> wrote:
It seem Nginx v1.9.5 supports HTTP/2

nginx doesn't support HTTP/2 to the backend yet. That is necessary for gRPC.

You may want to take a look at nghttpx.
Message has been deleted

Eric Anderson

unread,
Aug 3, 2016, 12:39:26 PM8/3/16
to nevil...@gmail.com, grpc.io, jdov...@gmail.com
On Tue, Aug 2, 2016 at 2:36 PM, <nevil...@gmail.com> wrote:
I supposedly managed to implement an nginx proxy to a Node.js app using HTTP2. It was working well, so I assumed that nginx supports HTTP/2 to the backend.

Hmm... I may be out-of-date. What configuration did you use? Are you sure it was using HTTP/2 to the backend and not just to the client?

nevil...@gmail.com

unread,
Aug 3, 2016, 12:42:19 PM8/3/16
to grpc.io, nevil...@gmail.com, jdov...@gmail.com
My bad, I removed my post after I realised that it was by chance. I can confirm that I couldn't get latest nginx to work. I spent the afternoon trying to figure out how to use nghttpx, but I finally got it working 1/2 hour ago.

Looks like the 'by chance' part was firewall rules. My Node.js application is in an LXC container, but somehow PREROUTING firewall routes affect networking, so that wasn't going to work well in the long run.

jdov...@gmail.com

unread,
Aug 11, 2016, 11:03:20 AM8/11/16
to grpc.io, nevil...@gmail.com, jdov...@gmail.com
Could you share your nghttpx configuration please?

If I go with a TCP load balancer like haproxy, what won't work properly with gRPC.

Thanks.

nevil...@gmail.com

unread,
Aug 11, 2016, 11:06:43 AM8/11/16
to grpc.io, nevil...@gmail.com, jdov...@gmail.com
I wrote a blog post about it, let me know if it helps

jdov...@gmail.com

unread,
Aug 11, 2016, 11:47:18 AM8/11/16
to grpc.io, nevil...@gmail.com, jdov...@gmail.com
Thanks. 

Apparently there is another thread discussing the Google Cloud Load Balancer (GCLB) for use with gRPC:

jdov...@gmail.com

unread,
Aug 16, 2016, 10:57:55 AM8/16/16
to grpc.io, nevil...@gmail.com, jdov...@gmail.com
I'll give this a try later. I don't need TLS so i'll leave out the certificate stuff. 

I really hope this works !

On Thursday, August 11, 2016 at 8:06:43 AM UTC-7, nevil...@gmail.com wrote:
Reply all
Reply to author
Forward
0 new messages