datastore putの速度 100件put | google app engine

datastore の putが遅いです。
でも複数のアイテムを同時に入れてもあまり変わらない?らしいので確認。

http://code.google.com/intl/ja/appengine/docs/python/datastore/overview.html

にある通り500エンティティはput出来るようなのでついでに500も

( 0.3 sec は、ほとんどネットワークの問題です。)
1つのputに2.3秒かかります。
100個のputは4.3秒でした^-^。
500個のputは7.9秒でした^-^。

model詳細は適当に消したので気にしないでリストに100個入れてdb.put()するだけです。

        model_list = []
        for key in self.list:
          item = MyModel(key_name=self._generateKey( key ))
          item.en = datetime.datetime.fromtimestamp(float(self.list[key]['e']))
          item.setData(self.list[key]['t'],self.list[key]['u'],self.list[key]['i'],self.list[key]['d'])
          item.pr = self.list[key]['p']
          item.bi = self.list[key]['b']
          model_list.append(item)
        db.put(model_list)

1件のときの結果

2.3605380058289

object(stdClass)#1 (2) {
  ["success"]=>
  int(1)
  ["error"]=>
  array(0) {
  }
}

100件の時の結果

4.3123650550842

object(stdClass)#1 (2) {
  ["success"]=>
  int(100)
  ["error"]=>
  array(0) {
  }
}

500件


7.8790979385376

object(stdClass)#1 (2) {
  ["success"]=>
  int(500)
  ["error"]=>
  array(0) {
  }
}

500件入れてみた後Current loads が、、、どういう意味でしょう?

大量のデータを毎日流し込むとstorageは増えるのは承知してたけどCPUの負荷はどうなんだろ
Datastore CPU Timeは変な数字だな。
qouta要チェックだ。

This entry was posted on 日曜日, 5月 8th, 2011 at 5:03 AM and is filed under blog, Google App Engine, Python. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.

Unityによるゲームを公開しております iOS/Android
https://itunes.apple.com/jp/app/lost-knight-3d-action/id900917032
https://play.google.com/store/apps/details?id=com.groundroad.runknight

各種開発支援・機能開発等小さいお仕事などもお請けしております。
unity開発支援, PHPシステム開発, javascript/html5 フロント開発, titanium mobileアプリ開発
お気軽にお問い合わせください
大崎・五反田近郊での対面でのお打ち合わせはいつでも可能です。