2

意识到数据存储在 Google AppEngine 上的所有应用程序版本之间共享这一事实,我最近创建了一个单独的应用程序版本,用于特殊目的。

然而,我注意到,尽管这个版本执行的代码与生产版本几乎相同,但它对客户请求的响应速度明显慢于生产版本;某些请求通常会导致DeadlineExceededError.

我现在可以在日志中观察到的典型错误如下所示:

...
friend.put()
  File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/db/__init__.py", line 1070, in put
    return datastore.Put(self._entity, **kwargs)
  File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/api/datastore.py", line 579, in Put
    return PutAsync(entities, **kwargs).get_result()
  File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/api/apiproxy_stub_map.py", line 612, in get_result
    return self.__get_result_hook(self)
  File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/datastore/datastore_rpc.py", line 1601, in __put_hook
    self.check_rpc_success(rpc)
  File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/datastore/datastore_rpc.py", line 1234, in check_rpc_success
    rpc.check_success()
  File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/api/apiproxy_stub_map.py", line 576, in check_success
    self.wait()
  File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/api/apiproxy_stub_map.py", line 550, in wait
    assert self.__rpc.state != apiproxy_rpc.RPC.IDLE, repr(self.state)
DeadlineExceededError

我的问题是:GAE 数据存储操作延迟是否会在非生产应用程序版本上持续增加?如果是这样,在仍然使用非生产应用程序版本的同时,有没有解决这个问题的好方法?

4

1 回答 1

0

Does the log entry for those entries with DeadlineExceededError also include this message?

This request caused a new process to be started for your application, and thus caused your application code to be loaded for the first time. This request may thus take longer and use more CPU than a typical request for your application.

Maybe that's what is causing it to go over the time limit.

Another option is to set up Appstats and see exactly where the time is being spent.

于 2013-07-31T22:03:05.320 回答