Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

google app engine modules - long running tasks > 10 minutes

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 ?

like image 244
rakesh.usenet Avatar asked Feb 22 '14 19:02

rakesh.usenet


People also ask

Is App Engine always running?

App Engine attempts to keep manual and basic scaling instances running indefinitely. However, at this time there is no guaranteed uptime for manual and basic scaling instances.

What is runtime environment in Google App Engine?

Google App Engine provides four possible runtime environments for applications, one for each of four programming languages: Java, Python, PHP, and Go. The environment you choose depends on the language and related technologies you want to use for developing the application.

How long is the instance startup time for service instances running in the App Engine standard environment?

10 minutes for HTTP requests and task queue tasks.


1 Answers

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

like image 177
Andrei Volgin Avatar answered Sep 22 '22 19:09

Andrei Volgin