Google应用引擎无法比在Google应用引擎中的backends.yaml中定义的后端实例更多地实例化任务队列 [英] Google app engine cannot instantiate task queues more than the back end instances defined in backends.yaml in Google app engine

查看:129
本文介绍了Google应用引擎无法比在Google应用引擎中的backends.yaml中定义的后端实例更多地实例化任务队列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经定义了后端配置,如下所示。

 后端:
- 名称:mybackend
class:B8
options:public,dynamic
instances:6

和Um创建超过6个taskqueue实例并将目标指定给我的后端。

$ p $ class TestHandlerTest(RequestHandler):
def get (self):
在范围内(0,100):
taskqueue.add(url ='/ testhandler /',method ='GET',params = {'x':x},
target ='mybackend')
return Response()

$ b $ class TestHandler(RequestHandler):
def get(self):
time.sleep(420)
x = self.request.args.get('x')
return Response()

在GAE任务队列中,只能使用6个任务队列实例进行排队。它不会运行到100.如果我们使用前端,任务队列将以
排队等候所有任务队列。


为什么我们不能在google app引擎中排队超过指定后端实例限制的任务?任何人都可以帮忙吗?

解决方案

您已经配置了6个后端实例。您可以根据需要添加尽可能多的推送任务到这些后端。
为此,您必须针对添加的每个任务定位后端实例。
因此target ='1.mybackend'为第一个实例,'2.mybackend'为第二个后端inatnce。

I have defined the backend configuration as follows.

 backends:
 - name: mybackend
   class: B8
   options: public, dynamic
   instances: 6

And Um creating more than 6 taskqueue instances and given the target to my backend.

 class TestHandlerTest(RequestHandler):
    def get(self):
         for x in range(0, 100):
             taskqueue.add(url='/testhandler/', method='GET',      params={'x': x},
                        target='mybackend')
         return Response()


 class TestHandler(RequestHandler):
     def get(self):
         time.sleep(420)
         x = self.request.args.get('x')
         return Response()

In GAE taskqueue only getting queued with 6 taskqueue instances . It wont run up to 100. If we use front ends the taskqueue getting queued with all the taskqueues .

Why cannot we queued more than the tasks specified backend instance limit in google app engine? Can any one help?

解决方案

You have configured 6 backend instances. You can add as many push tasks as you want to these backends. To do this you have to target the backend instance for each task you add. So target = '1.mybackend' for the first instance and '2.mybackend' for the second backend inatnce.

这篇关于Google应用引擎无法比在Google应用引擎中的backends.yaml中定义的后端实例更多地实例化任务队列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆