On Sun, Jul 22, 2012 at 2:05 AM, Aleksei Rovenski
<[email protected]> wrote:
> I can understand that GAE is more optimized for python than for java.
> Maybe it is a highly specialized tool for really tiny apps that use no
> frameworks. But I don't get one thing. How Google plans to compete for
> java apps by selling platform that forces you to not use frameworks? I
> simply refuse to go back into the 90's (in software development
> aspect, no problem otherwise :)). I simply do not want to drop
> dependency injection and other patterns I have been doing for many
> years already. If I must, then I think it just isn't worth it.
> Seriously Java is about frameworks. Saying not to use frameworks in
> java is same as use python instead. No thanks.

Don't listen to Brandon.  By and large you can use frameworks and
*should* use frameworks, because "framework" is just a word for code
you would otherwise have to write yourself.  Google doesn't want to
send you back to the late 90s programming styles (even if Brandon
does), and nobody sane will seriously suggest you break your app into
hundreds of tiny deployments.

It is a known issue with the GAE Java environment that instance starts
for nontrivial applications take significant time -- enough to
negatively impact the user experience if a user request gets routed to
a cold start.  Some frameworks make this problem worse than others,
but ultimately it is a linear relationship with the amount of code in
your app.

Maybe Google will be able to radically improve instance startup time
in the future, but probably not.  There have been incremental
improvements but it's a difficult problem because the JVM loads code
very differently from Python or Go.

The key is to prevent users from seeing cold starts in the first
place.  Takashi has posted one workaround:  Keep "min idle instances"
high enough that there is always enough capacity.  This works but it's
not ideal.  It costs more and there is always the chance that a sudden
burst of traffic will overload the idle instances and route a request
to a cold start.  You can decrease the chance of this by adding even
more min idle instances but that costs even more.

My hope is that the scheduler can be made smart enough to always keep
requests in the pending queue until new instances are warmed up.  I
believe that GAE used to do this, but something recently changed so
that it no longer does.  If requests never see cold starts, it really
doesn't matter how long your app takes to start - you can optimize
capacity for time-to-service-each-request latency, instead of the %
chance that a user request will get sent to an instance for 20+
seconds.

So - don't panic.  There is a solution that works right now, assuming
you have reasonably smooth traffic patterns:  Pay a bit more than you
would otherwise for more idle instances.  But also star this issue,
which IMHO is a better long-term solution:

http://code.google.com/p/googleappengine/issues/detail?id=7865

Jeff

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

Reply via email to