views:

410

answers:

2

I have a Google App Engine app using Java and Spring MVC 3.0. A lot of the time if it goes even 2 minutes without a request, then the next request is a loading request which takes about 12 seconds to respond to and uses about 5 seconds of CPU time. Sometimes it does a loading request even when there was no traffic for only one minute.

Google says once there is a steady flow of traffic to your site then you won't have to worry about it, but even if I had a steady flow, there would probably still be times when I went without traffic for 1 minute.

Is this a normal amount of idle time for the JVM instance to be deactivated?

EDIT: After investigating I found that JDO initialization is the part that takes the most amount of time (~6 seconds). And after I turned component-scan off of spring, and manually specified the controllers, spring setup time went down to 1.5 seconds. If I don't use jdo on a loading request, then loading request response time is a more reasonable ~3 seconds instead of ~12 seconds.

What would be nice is we could serialize the DispatcherServlet to the memcache.

A: 

Current evidence seems to point towards AppEngine recycling your application's resources after rather short idle periods, and that can definitely be a major hardship for applications like yours that have lengthy boot-up times. I am currently unaware of any solution to this problem.

Adam Crossland
And some devs are trying to game the system by having their sites hit by pings fairly often. Which means Google combats that, and so on.I used to go 20 minutes before needing a bounce - now it's a couple minutes. Have never tried to game it.
Richard Watson
+1  A: 

There has been a fix by the Google team, and now loading requests are only happening every 10 minutes or so, which is much more reasonable.

Kyle