With buffered read/writes to HTML you can’t output a few lines do something, output a few more, I get that.
But can I say “Your process will be completed shortly” close the output, and then Log some stuff, make some updates to the data store, but let the user get on with life?
-Brandon
How would this be different than shunting any remaining work off to
the task queue?
Jeff
Now that I know... This looks great, and it appears that what I should have
done with ASync writes should have been done with task queues.
Do Task Queues Execute on the Front end instances? Or will adding tasks spin
up a second instance?
I'm currently serving 30k visitors a day per instance, and I don't know if
tasks would take some users from 1 instance to 2 instances.
-Brandon
Jeff
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to google-a...@googlegroups.com.
To unsubscribe from this group, send email to
google-appengi...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en.
-----Original Message-----
From: google-a...@googlegroups.com
[mailto:google-a...@googlegroups.com] On Behalf Of Jeff Schnitzer
Sent: Monday, January 23, 2012 11:15 AM
To: google-a...@googlegroups.com
Subject: Re: [google-appengine] 'Flush' Like "I'm tapping out but keep
working" in Python?
Jeff
--
Tasks are processed just like normal requests; they share the same
memcache, instance memory, etc as your normal application.
Tasks are, however, separate requests so if you have some thread local
data it won't be available in the later task execution thread. Also
sometimes the task queues get backed up so it's hard to absolutely
predict when a task will be run. Usually it's pretty instantaneous
though.
One thing that makes tasks easier is the Deferred feature, available
in both Python and Java.
The task queue rocks. I lean on it pretty heavily. Also, you can
enlist some number of tasks (5, I think) transactionally, which
creates a good way to work around 2pc issues.
Jeff
Now I have to go do a re-write... Save MORE money on my GAE bill. Maybe
Google should pay you and me not to post to the forums. :-)
Robert
Yeah I'd love to see the ability to give task queues a priority
relative to user requests and relative to each other. That would be
pretty cool. Of course if they implement that then we could probably
get even finer control over the scheduler -- which could be handy as
well!
Robert
Yeah, I love this idea. A way to designate a queue so that it isn't
factored in for instance spinup (or keep alive), but would just run
tasks when there are instances sitting around waiting to get killed
off. I've got a lot of processes I'd like to run in that type of
mode, or at least the "don't cause new spinup mode".
Something to think about with that, you can specify the maximum
concurrent requests for a queue. So you can stop it from rampant
instance spinup. Just set a low concurrent rate, and that would at
least limit the queue to processing as much as X instances can handle.