Ever since the 1.7.6 dev_appserver (aka dev_appserver2) upgrade, I see 
multiprocessing for requests. That is, if I define a simple app like this:

import logging
import time

from google.appengine.api import taskqueue
from google.appengine.ext import webapp

class MyTaskHandler(webapp.RequestHandler):
    def post(self):
        logging.info("howdy, this is a tasky!")
        time.sleep(5)
        
class MyHandler(webapp.RequestHandler):
    def get(self):
        logging.info("howdy, this is test!")
        for i in range(20):
            taskqueue.add(url="/tasky")

application = webapp.WSGIApplication([("/test", MyHandler),
                                      ("/tasky", MyTaskHandler)])


and then run a zillion *curl http://localhost:8080/test* request 
simultaneously, I can see multiple instances created, they run in parallel, 
the new admin interfaces shows them to me, it's just like it runs in the 
sky. That's great!

But in the code, above, I'm also creating 20 tasks that run on /tasky for 
each hit to /test.
I can see those enqueued on the default queue. Because of my sleep, they 
take a few seconds to run.
But they're getting run serially. So it takes ~100s to run those 20 tasks, 
rather than 5s.
Even if I go into the admin interface and hit the "Run Now" button on each 
one, they still are pulled off the queue serially.
One "lucky" instance handles all of the task queue request. That's not so 
great, because it's making local runs of our test suite take a lot longer 
than they do in the sky.

*How do I tell dev_appserver to run those tasks in parallel?*
If this isn't possible, can someone help me understand why? I can easily 
POST directly to /tasky, and get the effect I want 
I thought multiprocessing support was a design goal for dev_appserver2 
- why isn't taskqueue doing this for me?

Thanks!
-ckhan

-- 
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-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to