我在Google Cloud中有一个项目,其中有2个任务队列:process-request
接收请求并处理它们,send-result
将已处理请求的结果发送到另一台服务器。它们都在名为remote-processing
我的问题是,我看到任务正在send-result
中排队,但是它们仅在process-request
队列为空并已处理所有请求之后才执行。这是实例配置:
instance_class: B4
basic_scaling:
max_instances: 8
这里是队列配置:
- name: send-result
max_concurrent_requests: 20
rate: 1/s
retry_parameters:
task_retry_limit: 10
min_backoff_seconds: 5
max_backoff_seconds: 20
target: remote-processing
- name: process-request
bucket_size: 50
max_concurrent_requests: 10
rate: 10/s
target: remote-processing
澄清:我不需要按特定顺序运行队列,但是我觉得很奇怪,保险一次只能运行一个队列,因此它只会在以后运行另一个队列中的任务当前队列已完成。
Google Cloud Tasks do no guarantees以任何特定顺序执行任务。如果您的应用程序依赖于以任何特定顺序执行的任务,则应重新设计应用程序的计划。