This a long time issue for java apps.
And it seems GAE team doesn't care this issue.
Basically, this is a gae instance scheduler defect.

Currently, only one way to avoid the slow startup problem:
buy more always-on instances.

On Oct 20, 12:57 pm, Casey <j.casey.one...@gmail.com> wrote:
> I've been developing an application for quite some time and I always
> noticed the following things while testing:
>
> - The first hit to the quiet server took a long time due to
> application startup. Anywhere from 10-30 seconds. Sometimes I see 60
> seconds.
> - Performance would be ok but it seems like a lot of extra instances
> would be spun up with just a single user. That's even with safe
> threading enabled.
> - Of course after a few minutes of idle time the instance would spin
> down and then the next request would take a long time to process while
> a new instance was spooled up
>
> I should also mention that I'm using GWT with RPC and I'm using Spring
> to manage all of my services. I do think that the use of Spring is why
> my application takes so long to start up. Since the datastore EMF
> handles my transactions I really only use the spring framework to
> provide dependency access to singleton beans across servlets and RPC
> services. But the primary reason I use Spring is for the session
> scoped bean so that I can store objects in the session. I actually
> don't store much in the session, just the current user id so
> performance should be OK.
>
> During QA I was kind of OK with with the bad performance because I
> attributed the delays with the spooling up of instance #1. Yesterday I
> enabled the persistent instances where I pay $9 a month to have three
> instances constantly powered on and waiting. That seemed to work at
> first. My first hit to server where I access a JSP is pretty fast.
> Login then takes awhile and then my first RPC call took forever. When
> I looked at the instances it made sense. Even though there were three
> instances waiting for traffic, for some reason, a single user
> accessing the server caused another three instances to be spooled up
> for a total of six. Again, this is just for a single user accessing
> the system.
>
> I've since accessed appstats and inserted a bunch of logging
> statements. As far as I can tell, all of my datastore requests are
> <100ms. Since some RPC calls make multiple calls to the DB I see some
> request times around 0.5s or 1s. I wouldn't think that such a time
> would cause additional instances to be spun up. So my only guess as to
> why additional instances keep getting spun up is that Spring is taking
> forever to load the small configuration files. It also looks like
> Spring isn't initialized until login is called. Post access to the
> JSP.
>
> So what do I do? I've tried to optimize Spring startup as much
> possible but that clearly doesn't seem to be working. Does anyone have
> any suggestions or do I have to figure out how to completely ditch
> Spring and use Guice for my dependency injection. If that's true, what
> do I do about the session scoped bean? I found a bunch a GAE session
> projects for python but so far I haven't found one for managing
> session objects in java. Does anyone have any ideas?

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to