Here is a counter example. We are a small app with peak traffic of 1 request 
per second. We use java. No frameworks. We use jdo, guice. Startup time 20 
seconds. Average request latency under 500 ms. We have been on appengine close 
to 2 years. Right now we are able to serve our users with one instance without 
exposing them to loading requests ( almost zero ) We use min = auto , max = 2 
and pending latency = 7.5 s. we arrived at this configuration after some 
experimentation and it gives the best performance and cost so far... At least 
we are fine now, unless google decides to change something.

We do have our share of problems with gae ( memcache errors, sudden increase in 
latency for brief periods..) But that's negligible relative to the advantages 
of the platform and cost.

Learnings 

Avoid warmups/loading requests at all costs. Our goal was never let gae start 
extra instances, as that can lead to instability. We cannot reduce startup 
time, and gae cannot get rid of all the issues associated with startup. Min = 1 
max = 1 gave us the worst performance as it creates a constraint that spins lot 
of instances esp if you have a bursts of traffic. Min = auto allows us to use 
pending latency config and it gives better control on the scheduler behaviour. 

Disclaimer

Probably this worked for us because  we have a steady request pattern during 
the day, and we don't normally see zero traffic for more than a few mins. if 
you are an app with different behaviour ( long idle times ) then min = auto may 
expose the user to loading requests..in this case min = 1 max = 2 or more 
should work better.. Again our $.02 cents...your mileage may vary....


Hope this helps.


Prashant




Sent from my iPad

On 22-Jul-2012, at 3:20 AM, Tomas <tomas.ada...@gmail.com> wrote:

> Hi guys,
> 
> I actually didn't want to reply to this thread originally even I was the one 
> who opened the small thread 3 months ago regarding the very slow startups on 
> gae with spring + velocity + objectify but after reading the email telling me 
> I should "write modular apps and don't use frameworks" I have to write up 
> something.
> 
> I'm 10+ years java developer and I'm big fan of Spring as it saves a hundred 
> hours of time - I originally developed the www.librarist.com 2 years ago as a 
> pet project on app engine as a just a prototype using simple JSPs + Servlets 
> and it works working fine (startups 3-5 secs).
> 
> But when I wanted to add another features like cart, OAuth login, use 
> templating, use proper caching - and I decided to go with Spring as this the 
> reason why we have frameworks. Plugging in Velocity is just matter of 1 line 
> of code in XML (plus some tweaks if you need them), the cache is again couple 
> of lines in XML and you automatically get in memory + memcache with ehcache, 
> authentication is 2 lines of code. And I can continue.
> 
> I use spring in work for other projects which runs on full java stack (but 
> thats just Tomcat/Jetty) and when I run the "new" librarist equivalent code 
> on Micro instance on AWS (which is like 600MB ram and 1.8Ghz - I might be 
> wrong here a little bit), the startup is 2-3 secs and I can serve all my 
> traffic with it with load at max 0.5.
> 
> When I run the similar code on GAE, I get 45+ secs startup (when I'm lucky, 
> sometime it just go over 1 nib and got killed) and then GAE keep spinning 
> another instances like crazy but very often use them for three request and 
> then dying to get started again. Worth to mention - I do not  use the full 
> Spring stac, basically its just Spring core + Spring MVC, then objectify + 
> Velocity - and I really tried to do all the possible optimizations (packing 
> all the stuff into one big jar, used annotations + java confing, used XML, 
> disable scanning of annotations) but these changes just save me like 4-5 secs 
> from 45 secs.
> 
> When I tried just Spring code + Spring MVC without any other library (and 
> here we talk about ~2MB of jars), use one JSP, my best startup time is 15 
> secs.
> 
> Okay thats cool, I can understand the  GAE is different and basically it 
> could be used just for small projects where you write everything by yourself 
> and don't use any normal stuff like Dependency Injection / Proxying and 
> similar. But my biggest question for GAE guys would be this - why the hell 
> the startup takes so long simply I don't get what is actually the issue here:
> 
> - is it loading of the jars from the network (virtual drive) when the gae 
> loads each class as separate file
> - is it the scanning of the classes (annotations etc)
> - is it java reflections
> - is it creating of proxies (which Spring does for almost everything)
> - anything else I can't see
> 
> I really REALLY liked the idea of the app engine since I hate to mess up with 
> server configuration and it's great to focus on SW alone. But honestly 
> speaking, I gave up on GAE for serious projects - it's good platform for 
> doing some quick prototype to show to client (easy deploy, no server 
> maintenance, you can have a simple app talking with a lot of apis up and 
> running in half a day) - but then move the stuff the AWS.
> 
> I made this decision 3 months ago and from the app engine google groups I can 
> see it was right thing to do as there is more and more emails coming in 
> regarding broken live apps, issues with deploys, issues with startups and 
> stuff like that (the SSL cert price is just a joke for example).
> 
> I really appreciate the work done on the GAE by Google but if I could give an 
> advice - please stop adding new features with every release, invest one month 
> of time of your team and do a proper maintenance release which will fix all 
> that shit around Java apps (this really can't be so hard) or you will lose 
> the war and all java devs will run away to AWS/Heroku/Cloud Foundry/Own 
> servers.
> 
> Cheers.
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Google App Engine" group.
> To view this discussion on the web visit 
> https://groups.google.com/d/msg/google-appengine/-/ozWj4QUDBDkJ.
> To post to this group, send email to google-appengine@googlegroups.com.
> To unsubscribe from this group, send email to 
> google-appengine+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/google-appengine?hl=en.

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

Reply via email to