Wednesday, June 02, 2010

Other voices: App Engine Cold Start Tips

The Google App Engine starts and stops web applications quite frequently to add resources or to free resources for other applications. App Engine developers should change the way they write their code to optimize the startup time. I'm working on a more comprehensive guide on how to do this. This will take some time to write and publish though.

In the meantime, there are resources on the internet providing tips on how to reduce cold startup times for the App Engine. For example, take a look at this post on the Answer Cow web log.

Running Saxon HE on Google App Engine

(Modified. Thanks to Archie Cobbs for the tip)

About a year ago I tested Saxon B version 8 on the Google App Engine. This worked (and still works) perfectly. You can implement XSLT 2.0 and XQuery on Google's hardware.

Later on, Saxon moved to version 9 and the naming changed. I tried the Home Edition on the App Engine and got the following error:

java.lang.SecurityException: SHA1 digest error for net/sf/saxon/s9api/SaxonApiException.class

Usually I think this should mean that the SHA-1 key is invalid. (I'm not exactly an expert on the subject of security). The easiest way around this error it to remove some files from the /META-INF of the saxon9he.jar file. If you remove SAXONICA.SF and SAXONICA.RSA and upload the file again, the library works.

[...]removed[...]

I Googled for the error message and there seems to be another App Engine project with the same error: the Vosao CMS. They say they fixed the error. I checked and yes: they also just removed the SHA-1 files from the JAR...


[...]removed[...]

As noted in a comment by Archie Cobbs, the cause of this problem could be the JAR precompilation feature of the App Engine. This means that signing JARs does not work in general unless you turn off precompilation. This is a security vs. performance trade-off.