Session affinity with several unmanaged instance groups accross several zones

152 views
Skip to first unread message

Benjamin Pineau

unread,
Nov 29, 2016, 4:09:52 PM11/29/16
to gce-discussion
Hello,

We're running an app on a group of webservers that need a complex provisioning/deployment (therefore is probably not a good candidate for managed instance groups).
This app needs cookie based stickiness (aka "session affinity").
And, as everyone, we'd rather survive a zone loss.

This scenario seems difficult to implement over GCE:
* Layer 4 ("Network") loadbalancing with target pool is another beast, entirely (no cookies for affinity, no X-Forwarded-For, ...)
* Unmanaged instance groups can't span multiple zones. You need several instance groups to tolerate a zone outage.
* Backend services affinity only works with a single instance group.
  This is undocumented afaik, and the API (and admin web interface) happily accept such a non functional setting.

Did I miss something obvious ? or does everybody out there runs clean and modern stateless
applications on immutable and respawnable servers ?

Thanks!

Faizan (Google Cloud Support)

unread,
Nov 29, 2016, 8:14:41 PM11/29/16
to gce-discussion
Hello Benjamin,

On Tuesday, November 29, 2016 at 4:09:52 PM UTC-5, Benjamin Pineau wrote:
Hello,

We're running an app on a group of webservers that need a complex provisioning/deployment (therefore is probably not a good candidate for managed instance groups).
This app needs cookie based stickiness (aka "session affinity").
And, as everyone, we'd rather survive a zone loss.

This scenario seems difficult to implement over GCE:
* Layer 4 ("Network") loadbalancing with target pool is another beast, entirely (no cookies for affinity, no X-Forwarded-For, ...)

Cookie based affinity is provided with the HTTP(s) Load balancer. As such,  you can use HTTP(s) load balancer instead of network to take advantage cookie based session affinity. You can refer to this link for more information.
 
* Unmanaged instance groups can't span multiple zones. You need several instance groups to tolerate a zone outage.

Unmanaged instance groups can be created in single zone only. As such, either you can have a managed instance group which has a multi-zone option or you can have multiple groups in different zones to provide high availability.
 
* Backend services affinity only works with a single instance group.
  This is undocumented afaik, and the API (and admin web interface) happily accept such a non functional setting.

You can have different instance groups added to multiple backends in a single backend service. Session affinity is part of backend service and will be applied to all the backends. For more information you can refer to this link.

Did I miss something obvious ? or does everybody out there runs clean and modern stateless
applications on immutable and respawnable servers ?

Thanks!

I hope that helps.

Faizan 
Reply all
Reply to author
Forward
0 new messages