开发者

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?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜