views:

591

answers:

3

Hello,

I am developing an application on GAE with spring MVC and using annotations. The application take a long time to load the first time and then it behaves well as long as I access the application. But then when I leave the application for a minute and then I access it again it is taking long time. I have read ppl having similar issues but did not talk about the solution. Has anyone had this problem and was able to fix it ?

One solution was stripping the annotations which I want to do as the last choice.

Thank You

+1  A: 

GAE kills you app if nobody clicks it for a minute.

irreputable
i figured that but I want no know if there is any solution for not doing that.
Oceandrive
use cron.xml to ping yourself every minute?
irreputable
Cron (or similar) is not a great solution because it'll likely have a temporary effect as Google combats everyone trying to do that, which they will if they want to keep costs down for everyone else.
Richard Watson
added a small cron job, which is keeping the application alive but as u said this is not a good solution.
Oceandrive
A: 

There's a precompilation-enabled property in the latest version that you can use to speed this up somewhat. See this article on why. It might not solve runtime-startup issues but I'm hoping the annotations are compile-time.

You can enable it for your application by adding precompilation-enabled to your appengine-web.xml:

<precompilation-enabled>true</precompilation-enabled>
Richard Watson
tried this but did not solve the issue
Oceandrive
+1  A: 

One way to speed up the initial loading of Spring would be to disable the <context:component-scan base-package="app.controllers" /> line in your springapp-servlet.xml and manually specify all of the controllers in your application like this:

<bean id="rootController" class="app.controllers.RootController" ></bean>
<bean id="otherController" class="app.controllers.OtherController" ></bean>

I'm using Spring MVC on Google App Engine and have gotten loading requests down to ~3 seconds.

Kyle