Understanding variability in pull queue adds

18 views
Skip to first unread message

stevep

unread,
Mar 12, 2013, 3:16:50 PM3/12/13
to google-a...@googlegroups.com
My app has a very simple handler function. It receives a small string payload and adds it to a pull taskqueue. Within a period of three seconds the latency for adding the task has varied from 44ms to 497ms. Since taskqueue adds are not async, and this can be a pretty busy function, the 497ms latencies are killers. App is paid High Response F1.

Two questions: 
1) Any insights why one GAE API call can vary so much within a second or two? 
2) Would it make sense to use a deferred function call?

Regarding the latter, it is not clear from GAEs documentation whether there is more overhead using a deferral rather than a direct put. Suggestion as I read them is more OH, so deferred would be worse unless it can be made async.

TIA.

Vinny P

unread,
Mar 12, 2013, 3:34:08 PM3/12/13
to google-a...@googlegroups.com


On Tuesday, March 12, 2013 2:16:50 PM UTC-5, stevep wrote:
1) Any insights why one GAE API call can vary so much within a second or two?

I've had the same experience as well - for instance Memcache calls that usually average a few milliseconds latency suddenly shoot up to 200+ ms latency. Similar things have happened to datastore calls. You're not alone, but there's nothing much that can be done about it. If I had to guess at a root cause, I'd say that the machine running the instance is overwhelmed with work/failing/etc.

 On Tuesday, March 12, 2013 2:16:50 PM UTC-5, stevep wrote: 
2) Would it make sense to use a deferred function call?
 
 If you really would like to queue a task asynchronously, what you could do is use fetchAsync in the low level urlfetch api ( https://developers.google.com/appengine/docs/java/javadoc/com/google/appengine/api/urlfetch/URLFetchService#fetchAsync(com.google.appengine.api.urlfetch.HTTPRequest) ) to call the Task Queue REST API: https://developers.google.com/appengine/docs/java/taskqueue/rest/tasks/insert 

There's probably an equivalent for Python, if you're a Python guy.

-Vinny P
Reply all
Reply to author
Forward
0 new messages