由于数据存储区在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数据存储区操作延迟是否会在非生产应用程序版本上持续增加?如果是这样,有没有一种很好的方法来解决这个问题,同时仍然使用非生产应用程序版本?
答案 0 :(得分:0)
DeadlineExceededError
条目的日志条目是否也包含此消息?
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.
也许这就是导致它超过时限的原因。
另一种选择是设置Appstats并确切地查看花费的时间。