I think of it this way:

- a task will execute if there is a token in the bucket (by consuming the 
token)
- the bucket size can be defined to hold a particular number of tokens
- the bucket will refill tokens at the queue rate

So, when the bucket is "empty", you are effectively processing at your 
queue rate (i.e., the rate at which the bucket is being refilled). The max 
bucket size is 100, so this allows you to have a small burst in processing 
if desired. 

This is the clearest description from the docs:


*The task queue uses token buckets 
<https://en.wikipedia.org/wiki/Token_bucket> to control the rate of task 
execution. Each named queue has a token bucket that holds a certain number 
of tokens, defined by the bucket_size directive. Each time your application 
executes a task, it uses a token. Your app continues processing tasks in 
the queue until the queue's bucket runs out of tokens. App Engine refills 
the bucket with new tokens continuously based on the rate that you 
specified for the queue.*



On Tuesday, 17 November 2015 11:10:26 UTC-8, Patrice (Cloud Platform 
Support) wrote:
>
> Hi,
>
> Since you have a bucket size of 5, the system will immediately start the 5 
> tasks you've asked. Then, because of the rate of your queue, over time 
> (each tenth of a second) your queue should get a new "token" that can be 
> used by your tasks. Depending on a lot of factor, the system can decide to 
> "hold" onto your token to only give you a significant amount (so instead of 
> a new token every tenth of a second, you may get a group of 5 tokens each 
> half-second). 
>
> For more information, I would suggest reading the official doc 
> <https://cloud.google.com/appengine/docs/python/config/queue#Python_Defining_push_queues_and_processing_rates>
>  (I 
> linked the section about processing rates, but the whole doc is helpful 
> here)
>
> Cheers!
>
> On Tuesday, November 17, 2015 at 12:09:36 PM UTC-5, Trez Ertzzer wrote:
>>
>> Hello.
>> I have been reading a lot of things about tasks and rate and bucket size 
>> but I cannot figure out how it works.
>>
>> suppose the rate is 10/s and the bucket size is 5.
>> suppose that I never added any task yet.
>>
>> now I add 20 tasks.
>> can you describe how the tasks will be executed?
>>
>> I understood, that 5 tasks will execute immediatly.
>> then what will happen...?
>> After how long another task will start? (and how many will start...)
>>
>>
>> thank you.
>>
>>
>> PS: I read this:
>>
>> https://groups.google.com/forum/#!searchin/google-appengine/bucket$20task/google-appengine/A1vC7raLfuY/h0Bi82Y5HCcJ
>>  
>> and this
>>
>> https://groups.google.com/forum/#!searchin/google-appengine/bucket$20size/google-appengine/4qBjwhvp_kU/wUlZAOJmOK8J
>>
>> but the information are really not clear
>>
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/a3d98838-24a2-4669-bb8b-1e7e919d1342%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to