Google app engine cannot instantiate task queues more than the back end instances defined in backends.yaml in Google app engine

不羁的心 提交于 2019-12-20 16:52:12

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/12851975/google-app-engine-cannot-instantiate-task-queues-more-than-the-back-end-instance

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!