back

iconwrite Optimizing your AppEngine website for the new pricing: How to get from 422 $ per month back to free in a few lines.

September 01, 2011, 15:57

There has a been a lot of badmouthing about Google's AppEngine new pricing. Basically it went from being rather cheap to just incredibly expensive compared to normal hosting. Each of my instances (using ~30 mb of memory) will now cost (0.08 x 24 hours x 30 days) ~= 57.6 $ per month. They generously offer you half price until november on Python instances... so it'll be only 28 $ per month per instance for a pair of months.

If your site has a reasonable amount of traffic you'll have several instances. In two weeks the cost of my private iPhone stats website will be going from 12$ a month to about 211$. Yes, Google is generous, they're leaving me a whole two weeks to adapt. I am even allowed to work on the week-end or at night if I want. If feel humbled by such generosity and to be honest it helps me fill my agenda that was otherwise empty.

But the cheap 211 $ price is only because Python instances are half-priced until november (to compensate they say for the lack of support for concurrency in Python until 2.7 is released.) After that, unless I spend an undetermined amount of hours on my stats website to implement concurrency possibly reducing the cost, the monthly cost will double. That is $ 422.– per month instead of $ 12.–. All that to save my iPhone apps stats using a total RAM for all instances that is below 256mb.

A bargain compared to say an OVH server that would only get me 16 GB of ram for 69 € / month . There's no way such a miserable machine could handle 700k requests writing to memcache per day... Oh wait it would. I wouldn't even even need memcache. I could just fucking write to the mysql database for every request and it'd work. Then I could use the rest of the machine's power to crack the human genome, again.

Of course my first reaction was anger but after calming down I found a simple trick :-)

A simple solution through simplificative optimization

Thankfully not all is lost. Using to some good old optimization and by trashing parts that weren't really necessary, I have been able to greatly reduce the cost of my stats websiste. Previously my /log page saved data in memcache and used an insane amount of memory of up to 30 Mb per instance. That was due to the titanesque processing required to store values in memcache and saving them to disk once every 20 minutes.

My previous code was basically an adaptation of this code.

I made some adaptations for the new pricing model and now the code is much simpler than before and reaches a very low latency so it can all run on one free instance instead of 7 :

AppEngine

Oh, and fuck you Google, seriously.

PS: While the code above is amusing it seems you can reduce further the load by just serving a static file instead, which I did.

4 responses to this post

I am totally with you. before I was a big Google Fan. Now I think Google is Evil.

September 01, 2011, 21:33 | Tom

Hey! You stole my joke! :-D -Russ

September 01, 2011, 22:31 | Russ

Honestly all this cloud computing stuffs are only for people who have more dollars than sense. Rent a dedicated machine and you'll get 24GB RAM and a fast quadcore 8 threads CPU all for less than $100 a month. How much does it cost to get the same thing on AWS or GAE or any other cloud platforms?

September 02, 2011, 17:50 | Andy

Well the fact that it runs on Google's platform and that you don't have to worry for maintenance or linux administration has a serious value for me. Hell I'd be glad to pay a flat 50$ monthly fee for that fact. While you can't directly compare the cost of a automatically maintained instance with your own server the price of each of Google's instances is just prohibitive. Also the fact that they can spawn instances at will without your settings having much effect on it doesn't seem very fair. But I assume it's just a big buggy at the moment.

September 02, 2011, 20:13 | Santiago Lema

Name
E-mail (will not be published)
Comment
rss Blog RSS Feed

rss Comments RSS Feed