Google appengine: Task queue performance

后端 未结 2 1545
野趣味
野趣味 2020-12-11 12:04

I currently have an application running on appengine and I am executing a few jobs using the deferred library, some of these tasks run daily, while some of them are executed

2条回答
  •  情歌与酒
    2020-12-11 12:37

    I think I finally managed to get around this issue by using two queues and idea proposed by the previous answer.

    • On the first queue we only query the main entities (with keys_only). And launch another task on a second queue for those keys. The first task will then relaunch itself on queue 1 with the next_cursor.
    • The second queue gets the entity keys and does all the queries and inserts on Full text search/BigQuery/PubSub. (this is slow ~ 15s per group of 100 keys)

    I tried using only one queue as well but the processing throughput was not as good. I believe that this might come from the fact that we have slow and fast tasks running on the same queue and the scheduler might not work as well in this case.

提交回复
热议问题