Okay I updated the recipe to use memcache and cron to synchronize
tasks and ensure exactly 1 task is ever active

http://appengine-cookbook.appspot.com/recipe/hot-handler

Robin

On Nov 12, 4:26 pm, Robin B <robi...@gmail.com> wrote:
> > Robin, do you have any idea how we can make sure, that a new keep-
> > alive task only gets insertet, if the queue is empty?  Unfortunately
> > there seems to be no method to query a task queue.
>
> I do not think you can read the queue length.
>
> Tasks will not be removed unless they receive a 200 http status code.
> Visting /_ah/queue/default as admin would insert another set of tasks
> which would be bad.
>
> I suspect that there were 9 non-200 HTTP responses (errors) that
> caused the duplicate tasks.  Fixing this problem would require
> synchronization using memcache and getting/setting a known key.  If a
> task detects that the value is not what it expected, then it does not
> write the key or insert the next task, because another task is running
> and already inserted its next task...
>
> To stop the tasks quickly, you can comment out the line that inserts
> the next task, and re-depoly so the current tasks will finish and not
> insert new ones.
>
> Robin
>
> On Nov 11, 7:28 am, Markus Gritsch <m.grit...@gmail.com> wrote:
>
> > Hi,
>
> > this is quite nice and it worked for me for some time now.  The app
> > loads fast, even if no one was visiting the site for hours.  Until
> > recently:
>
> > When I was visiting the appengine dashboard today, there were 9 keep-
> > alive tasks in the queue which raised the average request rate
> > considerably and ate up my quota :)  I think this can happen because,
> > according to the task queue specs, it may happen that a task gets
> > executet multiple times, not just once.
>
> > Robin, do you have any idea how we can make sure, that a new keep-
> > alive task only gets insertet, if the queue is empty?  Unfortunately
> > there seems to be no method to query a task queue.
>
> > Kind regards,
> > Markus
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to