Google App Engine - call the getSession () function. Invalidate (); makes the application engine act weird

When I call hreq.getSession().invalidate();, the application engine slows down a lot. I looked at appstats and saw that on a page where database calls were not called, it called memcache.get and datastore.get 23 times each. A stack trace of these calls showed that it was being called from getSession (). This only happens on the production server. Each time I make a request to a page, it creates a bunch of memcache and datastore messages. This slows down though when I restart my browser.

When I changed the code to just set the isLoggedInsession property to false, instead of calling hreq.getSession().invalidate();, everything was fine.

As a test, I did not invalidate my session, but I changed the value of my browser session cookie and the application engine showed the same behavior.

Is this a bug with the application engine?

+3
source share
1 answer

Not surprisingly, getSession () interacts with memcache and the data store. Take a look at the _ah_SESSION object using the data warehouse viewer. You will notice that this is Blob, and Blob is session information. Check out this .

App Engine , . App Engine , memcache . , , session.setAttribute() .

, , memcache, .

+2

Source: https://habr.com/ru/post/1747705/


All Articles