Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How exactly do Google App Engine for Java sessions work?

I know that app engine uses the memcache and the datastore for sessions. I can see in appstats that when i call getSession(), creating a new session, that 1 memcache and 1 datastore put occur.

However, in every single request of my app I get the current user object from the session. And no memcache or datastore gets show up in appstats.

How does that work?

like image 735
Kyle Avatar asked Aug 28 '10 01:08

Kyle


People also ask

How does Google App Engine Work?

App Engine is a fully managed, serverless platform for developing and hosting web applications at scale. You can choose from several popular languages, libraries, and frameworks to develop your apps, and then let App Engine take care of provisioning servers and scaling your app instances based on demand.

What is Java App Engine?

App Engine uses the Jetty servlet container to host applications and supports the Java Servlet API in version 2.4. It provides access to databases via Java Data Objects (JDO) and the Java Persistence API (JPA).

What is the difference between Google App Engine and Google Compute Engine?

Google App Engine is a Platform as a Service (PaaS) solution that makes deployment easier. On the other hand, the Google Compute Engine is an Infrastructure as a Service (IaaS) tool.

What is Google App Engine Architecture?

The App Engine architecturePlatform as a Service (PaaS) to build and deploy scalable applications. Hosting facility in fully-managed data centers. A fully-managed, flexible environment platform for managing application server and infrastructure. Support in the form of popular development languages and developer tools.


1 Answers

The Google blog "Easy Performance Profiling with Appstats" has a nice article that looks at profiling memcache in Appstats. It's discussed in Python, but references the use of Appstats for Java.

From: "Google App Engine > Appstats for Java"

How It Works

The Appstats servlet filter adds itself to the remote procedure call framework that underlies the App Engine service APIs. It records statistics for all API calls made during the request handler, then stores the data in memcache, using a namespace of __appstats__. Appstats retains statistics for the most recent 1,000 requests (approximately). The data includes summary records, about 200 bytes each, and detail records, which can be up to 100 KB each.

The Java version of Appstats uses fixed values and behaviors for how data is stored in the memcache and the datastore. (These cannot be configured as they can with the Python version of Appstats.)

If you're having problems with memcache data not showing up in Appstats, you might want to look at JCache as an interface to the App Engine memcache service. Or, there are a few tools tailored to reporting memcached statistics recommended here.

Cheers.

like image 73
S.Jones Avatar answered Nov 11 '22 12:11

S.Jones