On Fri, Apr 29, 2011 at 11:36 AM, footy <[email protected]> wrote:
>
> It is critical for me to present the front end (App1: Producer) to the
> users under heavy load. Thus the producer needs to be scaled
> differently. for eg: I might need 25 instances.


You can't control the number of instances directly, but you don't need to:

http://code.google.com/appengine/docs/python/blobstore/overview.html#Using_the_Blobstore

"...the user's browser uploads the specified files directly to the
Blobstore. The Blobstore rewrites the user's request and stores the
uploaded file data, replacing the uploaded file data with one or more
corresponding blob keys, then passes the rewritten request to the
handler at the URL path you provided to create_upload_url()."

ie. the App Engine infrastructure handles blob uploads asynchronously
and only calls your app with the blob key once all XMB has completely
uploaded.

The only thing your handler does is enqueue a task with the blob key.
As this takes only a trivial amount of time App Engine will easily
scale to the required number of instances.


> As for the worker back end (App2: Consumer) it is not that critical,
> and I am okay with a bit of delay as the consumer churns through the
> work load of various tasks queued in the task queue.
> Thus the consumer needs to be scaled differently. for eg: I might only
> need 5 instances to run through the tasks.


Here you have some control, although again not directly the number of instances:

http://code.google.com/appengine/docs/python/config/queue.html#Defining_Queues_and_Processing_Rates

queue:
- name: process-photos
  rate: 5/m


Whether you actually achieve a rate of 5 tasks per minute, or whatever
you set this to, depends on how long your task handler takes to
process a photo as this is one of the factors Google uses to decide
how many instances to run concurrently. If you can't process photos
fast enough your queue will back up.

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
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.

Reply via email to