cron

63 views
Skip to first unread message

Trez Ertzzer

unread,
Nov 14, 2015, 5:48:57 AM11/14/15
to Google App Engine
Hello.
I would like to know:

for how long can a "cron task" run?  normal task is 10 minutes. but what about the "cron task"...

thank you.

sorry if it written somewhere but I read this:

--> did not find my answer....

Alejandro Gonzalez

unread,
Nov 14, 2015, 6:12:07 AM11/14/15
to Google App Engine
Hello Trez,

A Cron Task is an scheduled HTTP request. The time it can run, depends on witch instance type receive the request. If you need a long process to run from a cron task, a common approach is to launch a task queue (from the cron request) in a Manual or Basic scaling module.

Cheers

Josh Moore

unread,
Nov 14, 2015, 1:15:09 PM11/14/15
to google-a...@googlegroups.com
For some additional clarification, a cron task is not necessarily a task queue task.  As Alejandro said, it can merely an HTTP request.  That means it can be of the following:

1) a request sent to a standard autoscaling instance (F* instances), be subject to a 60 second deadline; or
2) a request sent to a handler that triggers a task queue on a standard autoscaling instance, subject to a 10 minute deadline; or
3) a request sent to a basic or manually scaled instance (B* instances), subject to a 24 hour deadline.

When using cron, be aware that failures will only be retried at the next specified execution interval, except in the case of an HTTP 503 response from the target handler.  In that case, the request will retry indefinitely, as short-term quota exceptions return HTTP 503 and are typically safe to retry.

Cheers,
Josh

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengi...@googlegroups.com.
To post to this group, send email to google-a...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/5a3466ad-9e54-4af6-85e7-3654cf314847%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

Josh Moore | Cloud Solutions Engineer | josh...@google.com | 

Trez Ertzzer

unread,
Nov 18, 2015, 7:48:52 AM11/18/15
to Google App Engine
Hello.
Thank you for all these informations.
I have a few questions:
I am only using "Automatic Scaling".


1) so how much time does my "cron task" have to finish?
--> If we consider that a cron task is just an http request then 60 seconds, if it's a task then 10 minutes. Which is it?

2) if inside my "cron task" I create a DeferredTask and add it to a queue.  how much time does this new task have to finish? (I ONLY USE AUTOMATIC SCALING).
--> I guess 10 minutes... can you please confirm.

3) on this page : java/task_deadlines
Could you please explain to me:

"
A task must finish executing and send an HTTP response value between 200–299 within a time interval that depends on the scaling type of the App Engine module that receives the request. This deadline is separate from user requests, which have a 60-second deadline."
I really do not understand the part that is underlined!


Thank you very much for your help.

Josh Moore

unread,
Nov 18, 2015, 12:33:59 PM11/18/15
to google-a...@googlegroups.com
1) so how much time does my "cron task" have to finish?
The cron job/scheduled task, to an autoscaled instance, has 60 seconds to get a response back.  However, as you note...

2) if inside my "cron task" I create a DeferredTask and add it to a queue.  how much time does this new task have to finish?
It's common to have a cron job call a handler that fires off a bunch of tasks.  This way the actual work is handled in the 10 minute deadline, and the cron is handled within 60 seconds.  Your assumption is correct.

3) on this page : java/task_deadlines "This deadline is separate from user requests, which have a 60-second deadline."  I really do not understand the part that is underlined!
This is referring to the longer task deadlines, which are 10 minutes on Automatic Scaling (F1-F4) and 24 hours on Basic and Manual scaling (B1-B4).  

Hopefully this is helpful in clarifying your understanding of task queues. 

Cheers,
Josh

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengi...@googlegroups.com.
To post to this group, send email to google-a...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages