谷歌应用程序引擎模块 - 长时间运行的任务> 10分钟 [英] google app engine modules - long running tasks > 10 minutes
问题描述
我试图移植到谷歌应用程序引擎模块,这是一个以前长期运行的作业(运行在'后端')。
以下是一个样例module1.yaml。
application: myuniqueapp
模块:module1
版本:1
运行时:python27
api_version:1
线程安全:true
instance_class:F4_1G
automatic_scaling:
max_idle_instances:1
处理程序:
- url:/ data
static_dir:data
application_readable:true
$ b $ url - url: /.*
脚本:app.application
提交给此代码前端实例),通过taskqueue是这样的:
taskqueue.add(url ='/ tasks / do_my_task',
target ='1.module1')
这提供了没有问题的正确任务。该任务也由module1执行。
但它在DeadlineExceededError中被第10分钟杀死。这是一项长时间运行的任务,运行时间超过10分钟(比如它用于'后端'的工作方式)。
需要完成哪些配置更改,模块中执行的任务要> 10分钟?
您只需为您的模块选择手动或基本缩放:
https://developers.google.com/appengine/docs/java / modules /#Java_Instance_scaling_and_class
I am trying to port to google app engine modules, a previously long-running job ( running in 'backends' ) .
A sample module1.yaml is present below.
application: myuniqueapp
module: module1
version: 1
runtime: python27
api_version: 1
threadsafe: true
instance_class: F4_1G
automatic_scaling:
max_idle_instances: 1
handlers:
- url: /data
static_dir: data
application_readable: true
- url: /.*
script: app.application
The code to submit to this (from a front-end instance), via taskqueue is this:
taskqueue.add(url='/tasks/do_my_task',
target='1.module1')
This submits the right task without an issue. The task gets executed by the module1 as well.
But it gets killed by the 10th minute, with the DeadlineExceededError. This is a long running task and runs for longer than 10 minutes ( like how it used to work for 'backends' ).
What configuration change needs to be done, for the task executing in a module to be > 10 minutes ?
You simply need to choose manual or basic scaling for your module:
https://developers.google.com/appengine/docs/java/modules/#Java_Instance_scaling_and_class
这篇关于谷歌应用程序引擎模块 - 长时间运行的任务> 10分钟的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!