I've been able to nearly solve the delay problem by setting countdown=1 in the Task constructor. This reduces the delay from 20 to about 1.5. Not sure why it's not closer to 1.0 but this will be fine. The time to serve the simple request is unaffected.
Still a strange bug (?). Also, some other things lead me to believe the GAE just wants to "rest" for 20 seconds. I started to wonder if in my previous tests I was just running things through too fast, even though that seemed unlikely since I was seeing the same delays in production when tasks take 1+ minutes to complete. But I put a time.sleep(10) in my handler just to make sure. Strangely, what this did was reduce the delay from 20 seconds down to 10. So the sleep gives 10 seconds of rest and then GAE still wants 10 more? Something like that. When I replaced time.sleep(10) with a tight loop lasting 10 seconds, my higher delays returned although they were more erratic (i.e. not consistently near 20 seconds). Also, I tried creating a new app containing only the code I had written for my test, and got somewhat different results. I got the almost-exactly-20-seconds delay, but only about once every 4-5 requests. The other times it was near zero. Maybe this is because nothing else is going on in the app, so GAE has less need for "rest?" Almost as if it were a quota thing -- except the fact that I demonstrated earlier that I can eliminate the delay entirely by running tasks on a frontend, or using a 5-instance backend, or (as now demonstrated) setting countdown=1 seems to eliminate that possibility. All very strange. -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To view this discussion on the web visit https://groups.google.com/d/msg/google-appengine/-/wYRmOXSR5-wJ. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
