views:

30

answers:

1

Hello,

I need to run a script (python) in App Engine for many times. One possibility is just to run a loop and use urlfetch with a link to the script. The other one is to open a task with the script URL.

What is the difference between both ways? It seems like Tasks have a quota (100,000 daily free tasks) so why should I use them?

Thanks,

Joel

+1  A: 

Briefly:

  1. Bulk adding tasks to the queue will probably be easier, and possibly quicker, than using URLFetch. Although using async url-fetches might help with this.

  2. When a task fails, it will automatically retry. Assuming you check the status of your call, URLFetch might just hang for a while before you get some type of error.

  3. You can control the rate at which tasks are executed. So if you add 1,000 tasks fast you can let them slowly run at 10 / minute (or whatever you want), helping you not blow through your other quotas.

  4. If you enable billing, the free quota is 20,000,000 / tasks per day.

  5. Depending on what you are doing, tasks can be transactionally enqueued, which gives you some really powerful abilities.

Robert Kluin
This point from the docs should also be mentionned : "This web hook model enables efficient parallel processing - App Engine may invoke multiple tasks, or web hooks, simultaneously."
Franck