开发者

How does google appengine measure datastore put operations

开发者 https://www.devze.com 2023-04-03 11:49 出处:网络
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 l

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

精彩评论

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