简体   繁体   中英

How to avoid execution delays in Task Queues

How can we get Push Queue Tasks scheduled for execution ASAP after enqueuing?

Do we need to resort to cron jobs with Pull Queues instead?

We periodically see very long delays (20 minutes) in executing Tasks waiting in our Push Queues. We'll see 6,000+ tasks in the Queue with none executing and non executed in the last minute. Then the Tasks finally get scheduled to execute and we get a big burst spike as the queue is drained at a fast rate.

As an example, a queue definition looks like this:

<queue>
    <name>example</name>
    <target>1</target>
    <rate>20/s</rate>
    <bucket-size>40</bucket-size>
    <max-concurrent-requests>10</max-concurrent-requests>
    <retry-parameters>
        <min-backoff-seconds>10</min-backoff-seconds>
        <max-backoff-seconds>60</max-backoff-seconds>
        <max-doublings>2</max-doublings>
    </retry-parameters>
</queue>

Delays can occur with both pull queues and push queues. Task queues provide reliable task execution, never earlier than requested but sometimes later, for example when failing over from one data centre to another. The scheduling is best-effort, not real-time.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM