-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
App Engine Flex Session Affinity #242
Comments
+1 from me |
Note also that if session affinity is available, we can add a more efficient memory cache for sessions in each instance that will reduce the load on the shared session store and improve semantics for co-located requests. The image can easily be modified to take advantage of affinity. |
Just dicovered this It looks like in order to offer WebSockets on the flex environment "they" implemented session-affinity
|
@Petikoch Thanks for that - I'll test that out (probably next week) and if it works will see what session options should be turned on in the image to best make use of that. |
Excellent, thanks a lot @gregw |
I've done some testing with the session_affinity and it appears to work fine. It does not trigger off the env_variables:
JETTY_MODULES_ENABLE: session-cache-hash,gcp-datastore,session-store-gcloud This will avoid hitting the datastore on every request, sessions will only be written when dirty. I can see in my tests that objects in the sessions are coming back with the same value and same hashcode (so they have not been serialized deserialized)! I will add this to the doco! |
Signed-off-by: Greg Wilkins <[email protected]>
Pull request #260 documents this |
Should it be enough to set session_affinity to true in app.yaml to enable session affinity or is there a specific Jetty module that also needs to be enabled with JETTY_MODULES_ENABLE? Does the GCP Load Balancer needs to be set up too? Documentation does not say anything about that and I cannot see any additional cookies (like the GCLB cookie mentioned by @gregw before) set in the response after having enabled session_affinity. Or is it just websockets for which App Engine flex supports session affinity? |
If you set session_affinity to true, you will get session affinity implemented by the Google load balancer using its own additional cookie. This will work with no changes to Jetty. However, one of the main points of session affinity is to allow efficient session management from an in memory session cache, so if you have affinity, you can turn this on with the |
Thanks for the clarification, @gregw. This was exactly how I thought. However, as I wrote, basic session infinity does not seem to work in my case. I set session_affinity under network: in app.yaml, but do not see any additional (GCLB or other) cookies added to the HTTP responses. This is why I thought that I may be missing one or another Jetty module or the Load Balancer has to be configured in some way (I do not have configured it at all, so as I understand, all App Engine Flex defaults should be functioning). |
* Issue #242 Session Affinity Signed-off-by: Greg Wilkins <[email protected]> * fixed typo Signed-off-by: Greg Wilkins <[email protected]> * updates from review Signed-off-by: Greg Wilkins <[email protected]>
Hello, I believe the app engine flex uses the cloud load balancers underneath, correct? When will we be able to configure the load balancer to use session affinity? You can do it for a normal cloud load balancer in front of compute engine instances, why not app engine?
Using the gcp-datastore-sessions variable does not work in all cases, especially Vaadin apps where session affinity is required.
There are a lot of people wanting this feature!
The text was updated successfully, but these errors were encountered: