Dynamic Backend Instance Scaling

308 views
Skip to first unread message

Sean O'Connor

unread,
Aug 6, 2012, 5:54:48 PM8/6/12
to google-a...@googlegroups.com
Hello,

I am working on a project where we are using a dynamic backend as a pull queue worker.  Whenever we add a batch of tasks to our pull queue, we also add a task to a push queue targeted to the backend to wake up the backend and kick off the worker code.

Overall this has been working well for us as it allows us to offload work from our front-end instances without paying too much for idle backend instances.  The biggest problem we've been having with this approach has been understanding and predicting how the dynamic instances are scaled.  To that end, I have two questions:
  1. Is the "threadsafe" option enabling concurrent request handling in the python27 runtime used by dynamic backends?
  2. If so, does the dynamic backend instance scaling work similarly to front-end instance scaling or is there different rules at play here?
We've tried to read up on this in the docs and watching Google I/O talk videos but all we've been finding is somewhat vague or contradicting/outdated information.

Thanks!

-Sean O'Connor

Drake

unread,
Aug 6, 2012, 10:49:57 PM8/6/12
to google-a...@googlegroups.com

Backends only handle serial requests. This is one of the biggest limitation of Backends. 

 

--
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/-/6dLL0xNbjPUJ.
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.

Amy Unruh

unread,
Aug 6, 2012, 11:40:25 PM8/6/12
to google-a...@googlegroups.com
If you're using python27 with threadsafe set to 'true', and the backend is not already loaded, it should support concurrent requests.

 -Amy

Kyle Finley

unread,
Aug 7, 2012, 12:14:45 AM8/7/12
to google-a...@googlegroups.com, amyu+...@google.com
Amy, 

Are backends limited to 10 concurrent requests like frontend instances?

Amy Unruh

unread,
Aug 7, 2012, 12:18:10 AM8/7/12
to Kyle Finley, google-a...@googlegroups.com
On 7 August 2012 14:14, Kyle Finley <kylef...@gmail.com> wrote:
Amy, 

Are backends limited to 10 concurrent requests like frontend instances?

Yes-- the limits are the same as frontend instances.  Actually, at the moment the limit is 8 for python, and 10 for java.
 

Kyle Finley

unread,
Aug 7, 2012, 12:34:43 AM8/7/12
to Amy Unruh, google-a...@googlegroups.com
Yes-- the limits are the same as frontend instances.  Actually, at the moment the limit is 8 for python, and 10 for java.

OK, Thanks. Is this documented anywhere officially?

If anyone is interested in making this number configurable please star this future request:

Drake

unread,
Aug 7, 2012, 2:37:43 AM8/7/12
to google-a...@googlegroups.com

Hmmmm… I’ll check again we have had a lot of issues with 503 errors because instances wouldn’t spin up, and if a request was in the Queue for more than 10s we’d get an error.

 

I’ll have to check what we are doing wrong.

--

Robert Fischer

unread,
Aug 7, 2012, 2:54:39 AM8/7/12
to google-a...@googlegroups.com, Kyle Finley
I also thought that backends were single threaded, it was hard to find documentation saying one way or the other but after analysis of my logs I indeed confirmed I was running a number of concurrent requests on my B1 python27 runtime backend. 

-Robert

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
Reply all
Reply to author
Forward
0 new messages