Showing posts with label JVM. Show all posts
Showing posts with label JVM. Show all posts

Wednesday, October 21, 2009

JVM Coldstart on Google App Engine

When your application sitting on app engine has been idling for a while, app engine tends to shutdown the jvm instance containing your app, presumably to conserve limited resources.

I find that a problem because getting the application initially started up can be a slow and expensive process.

But the problem can be solved with cron jobs that call a url in your application at set intervals, thereby keeping your jvm all nice and warmed up.

Check out the documentation on the site.

All you've got to do is:
create cron.xml and place it in your WEB-INF folder


<?xml version="1.0" encoding="UTF-8"?>
<cronentries>
<cron>
<url>/recache</url>
<description>Repopulate the cache every 2  minutes</description>

<schedule>every 2 minutes</schedule>
</cron>
<cron>
<url>/weeklyreport</url>
<description>Mail out a weekly report</description>
<schedule>every monday 08:30</schedule>
<timezone>America/New_York</timezone>
</cron>
</cronentries>