FWIW I gave up on spring for that same reason. All of the reflection, scanning and parsing of XML or annotations is just not designed for an environment like appengine. It's meant for apps that start up once and stay up for a long time.
On Tuesday, July 10, 2012 8:19:44 AM UTC-4, rerngvit yanggratoke wrote: > > I read it earlier somewhere that Spring MVC is kind of too heavy for GAE. > The cold start time will be much lower if you use some other lightweight > libraries. However, this means you could not take advantages of mature and > advanced framework like Spring anyway. > > On Tue, Jul 10, 2012 at 2:13 PM, Jordi P.S. <[email protected]> wrote: > >> Hello guys, >> >> Tomas, I'm facing the same issues as you. I have Spring MVC with velocity >> and one single JSP and I get startup times from 50+ seconds. >> I started applying the measures you guys propose and I don't get major >> reductions. >> >> Have you fixed this issue already? >> >> Jordi. >> >> On Tuesday, April 10, 2012 3:47:57 PM UTC+2, jon wrote: >>> >>> Just did one quick test, it takes about 24 s to spin up an instance. I >>> guess all this code we've written has added about 10 s of startup >>> time. So far it hasn't been a problem because we reserve instances. >>> >>> Oh there's one other trick that we do. We map /_ah/warmup to a servlet >>> that exercises as much of our stack as possible. >>> >>> We use Spring 3.0.x. Our lib folder shows 47 individual JARs >>> (including our own). Yikes! >>> >>> On Apr 10, 6:12 am, Tomas <[email protected]> wrote: >>> > Hi, I've done all of those already and nothing helps. >>> > >>> > As I said - the simplest MVC with just minimal spring libraries >>> (excluding >>> > jpa/jdo app engine lib) with one JSP with only htm in it tak 13+ secs >>> to >>> > startup. >>> > >>> > I've spent two days trying to optimize everything (annotations >>> support, >>> > scanning, repacking to bigger jars) but nothing helps. >>> > >>> > 1) what version of spring do you use (maybe the 3.1 is causing >>> troubles) >>> > 2) how many other libraries did you have in your application >>> > >>> > Thanks. >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > On Monday, 9 April 2012 17:48:35 UTC+12, jon wrote: >>> > >>> > > Our app is also Spring-based. We did some optimisation about a year >>> > > ago. Don't really remember how quickly we got our app to start. I >>> > > think it was in the ballpark of the 13s result you got. 50s is too >>> > > long. >>> > >>> > > Here's what we've done: >>> > > * combine our own classes into one JAR >>> > > * reduce dependencies as much as possible (exclude unnecessary >>> JPA/JDO >>> > > dependencies if you're not using them) >>> > > * turn off Spring autoscan (we list Controllers explicitly, but we >>> do >>> > > use annotations inside the Controllers) >>> > > * use static instead of dynamic JSP includes when possible >>> > > * turn on JSP precompilation >>> > > * there may be a few other things I'm forgetting >>> > >>> > > On Apr 8, 6:16 pm, Tomas <[email protected]> wrote: >>> > > > Hi guys, >>> > >>> > > > I've decided to convert my servlet/jdo based app engine app to >>> spring >>> > > mvc >>> > > > (the current app is starting to limit me on doing quick >>> > > > changes/improvements in the code and as I have quite good >>> experience >>> > > with >>> > > > spring on standard non cloud platforms I've decided to give it a >>> go). >>> > >>> > > > So I've put together project including: >>> > >>> > > > - Spring + Spring MVC + Apache Velocity >>> > > > - ehcache + spring-annotations for ehcache + own >>> decorators/interceptors >>> > > > for appengine memcached >>> > > > - objectify >>> > > > - some other util classes ie jsoup, commons (util, baens, logging, >>> > > codec), >>> > > > gdata >>> > >>> > > > The lib directory contains ~42MB of jars (including appengine >>> libraries >>> > > > which makes ~25MB) >>> > >>> > > > After deploy, the app takes 50+ seconds to start (sometime the >>> first >>> > > > request get killed after 60 seconds and another app is started) - >>> I've >>> > > read >>> > > > some articles about speeding up the spring on gae and decided to >>> do >>> > > another >>> > > > little test. I've created testing app containing only spring + >>> spring >>> > > mvc >>> > > > with one controller (no other beans, but had to keep the >>> annotation scan >>> > > > enabled for mvc mapping - but disabled the component scan). The >>> > > controller >>> > > > simply forwards to JSP file with text. Deployed and the page got >>> > > displayed >>> > > > after 13 seconds. >>> > >>> > > > I knew the Spring with all proxies and scanning is not optimal for >>> GAE >>> > > but >>> > > > I wasn't expecting this at all - it seems like the app have issues >>> with >>> > > > simple loading the libraries as I can see how the memory of >>> instance is >>> > > > growing by 1 MB per second. I've tried to: >>> > >>> > > > 1) merge jars into 3-4 bigger ones >>> > > > 2) disable annotations (just for the test as with new spring mvc >>> its >>> > > quite >>> > > > hard to do some better mapping only in xml) >>> > > > 3) lazy load some spring beans >>> > >>> > > > And I can save like 5-10 secods from those 50+ seconds of my >>> startup - >>> > > is >>> > > > it really so bad for everyone or is there some magic setting? >>> > >>> > > > Whats your normal startup time of your spring based app? >> >> -- >> 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/-/wzMKMUqjlQgJ. >> 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. >> > > > > -- > Best Regards, > Rerngvit Yanggratoke > -- 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/-/5fF3CNB8n3oJ. 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.
