0

I want a serial queue where only one task may process at a time. This is my declaration in queue.xml:

<queue>
    <name>pumpkin</name>
    <rate>20/s</rate>
    <bucket-size>1</bucket-size>
    <max-concurrent-requests>1</max-concurrent-requests>
</queue>

Does the "rate" parameter have any effect in this setup?

I want tasks to queue up and only process one at a time.

Thanks

user1219278
  • 1,859
  • 5
  • 22
  • 27

1 Answers1

0

The queue rate and bucket size do not limit the number of tasks processes simultaneously. See this answer which captured a (now gone) official explanation of these configs better than the (current) official docs (you may want to revisit your configs accordingly): https://stackoverflow.com/a/3740846/4495081

However your max-concurrent-requests should ensure only one task is executed at a time, according to the docs:

You can avoid this possibility by setting max_concurrent_requests to a lower value. For example, if you set max_concurrent_requests to 10, our example queue maintains about 20 tasks/second when latency is 0.3 seconds. However, when the latency increases over 0.5 seconds, this setting throttles the processing rate to ensure that no more than 10 tasks run simultaneously.

Community
  • 1
  • 1
Dan Cornilescu
  • 39,470
  • 12
  • 57
  • 97