2

We're running a production operation in Heroku based on NodeJS and Websockets (MeteorJS) for a few months, using 3 instances configured with session affinity. Now, we want to migrate from Heroku to Google App Engine. The problem is, the application uses WebSockets in a way that it's required to run under "sticky sessions".

Looked exhaustively in GAE documentation, and there's no direct reference of how to do it using the app.yaml, neither how to put them behind a common GCE HTTP(S) Load Balancer, which already supports the Session Affinity configuration.

So, which is the best approach to get it running under GAE with multiple instances?

Luís Brito
  • 1,652
  • 1
  • 17
  • 34
  • This might be answered here: https://stackoverflow.com/questions/10640120/how-do-i-implement-server-affinity-or-sticky-sessions-on-app-engine – afed Jul 23 '17 at 18:12
  • Thanks for the link, but I'm looking for a network solution, that requires zero custom code (no Google Cloud SDK), something like the Heroku Session Affinity (BETA). – Luís Brito Apr 17 '18 at 16:20

2 Answers2

1

To give some feedback for future reference, we went with a networking approach. Google App Engine showed a lot of compromises we needed to take in order to make it work, so we moved the application to the Google Kubernetes Engine and configured session affinity in the Load Balancer as described in the link below:

https://cloud.google.com/load-balancing/docs/backend-service#session_affinity

Luís Brito
  • 1,652
  • 1
  • 17
  • 34
1

You can now also use Cloud Run for Session Affinity if you don't want to go through the pain of GKE. For this, you would only need to run the following command on your app:

gcloud beta run services update SERVICE --session-affinity

Link on documentation below:

https://cloud.google.com/run/docs/configuring/session-affinity

dsanmart
  • 11
  • 2