23
Mar
11

Blog running on AppEngine using Tornado

This blog is running on appengine for a long time. From the logs it was moved there in April 17, 2009. Today I changed the internal framework used for the blog and this post is to share the performance changes I could measure.

My personal experience with appengine (the cloud computing solution from Google) is quite good for tiny projects like this blog or letras gordas. It is not the cloud scalability that makes me happy, it is more the fact that I can just upload it to the cloud and expect it to continue running without having to do sysadmin work or without having to worry if things break the next time I need to upgrade or change the server software.

The first version of the appengine blog was done in django using django appengine patch, a great work from Waldemar Kornewald that allows running almost standard django in appengine. The django appengine patch is not supported anymore as development moved to django-nonrel that allows the same with a cleaner approach.

Although it is very convenient to be able to write and reuse django code, this framework is not the best option for appengine. It is a large framework that takes a lot of time to load the first time. That is not a problem for normal django deployment where the server is always loaded in memory but it is bad in appengine for apps with few accesses where everything needs to be loaded for most page views (this is called cold start). In order to have fast cold starts people have been using lightweight frameworks (webapp, tipfy, flask, tornado, and probably others) instead of Django. My personal choice currently is tornado.

So using django appengine patch a cold start (bellow) and a hot start (above) measured from Stella for the blog index:

And the same using tornado:

These results could be replicated several times with ~20% variation. So I could confirm the big penalty for Django cold start (from 800-1000ms in Tornado to 2300-2600ms in Django). Both seem to run quite well when running on memory (~200ms). So now this page should load faster. Yeahh.




1 Response to “Blog running on AppEngine using Tornado”


  1. 1 May 21, 2012 at 04:48 am by smewpy

    Thanks

Comments closed for this old post