Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does google appengine measure datastore put operations

With the appengine pricing changes, we've been paying attention to our datastore puts. According to the pricing comparison chart we're making 2.18 million puts a day. This seems a lot higher than expected. We receive about 0.6 queries per second which means that each request is making about 60 puts!!

Using the sample code for db profiling http://code.google.com/appengine/articles/hooks.html we measured this for a day and the most we counted was ~14,000 which seems more reasonable. Does anyone have experience with something similar on their site?

like image 542
probably at the beach Avatar asked Sep 06 '11 10:09

probably at the beach


Video Answer


1 Answers

The discrepancy you're seeing is because every index write is counted separately. When you do a datastore put, you're charged for the number of rows that have to be modified, so if you modified a single indexed field, you'd expect to be charged for:

  • One write for the entity itself
  • Two writes for the ascending index for the modified property
  • Two writes for the descending index for the modified property

For a total of 5 writes. As you can see, setting properties to indexed=False can have a big impact on your quota usage here.

like image 169
Nick Johnson Avatar answered Oct 13 '22 06:10

Nick Johnson