如何扩展 Azure Webjobs
How to Scale Azure Webjobs
我知道 webjob 随 webapp 扩展,即如果我的 webapp 在 5 个实例上 运行ning,那么 webjobs 也会在 5 个实例上 运行。 我只想知道是否有办法在网站的每个实例中拥有多个 webjob 实例。
注意:我已经有了 JobHostConfiguration.QueuesConfiguration.BatchSize = 32 的最大值。
现在,我的网络应用 运行正在 1 个实例上运行。 Webjobs 正在同时处理 32 个。 我的目标是同时处理 3*32 = 96 个。
实现此目标的一种可能方法是部署相同的 webjobs 3 次(为 webJobName 属性 设置不同的名称),但我不确定这是否是一个好的做法。请指出适当的文档。
config.Queues.NewBatchThreshold表示什么?
config.Queues.NewBatchThreshold的默认值是多少?
对于队列处理,config.Queues.NewBatchThreshold 的推荐值应该是多少?
正在从 https://github.com/Azure/azure-webjobs-sdk/issues/628 复制 Jon 的回答:
The NewBatchThreshold is the number of messages to have left to process in the batch before the SDK refreshes the batch.
For example, if your batch size is 20 and NewBatchThreshold is 5, the SDK will grab 20 messages off the queue each time, pass them to your code for you to process them one by one, then when it gets down to the last 5 unprocessed messages (so you've processed 15) it will grab the next 20. See here under "Parallel execution"
By default the NewBatchThreshold is half of BatchSize (see source code) which is why you are seeing a value of 0 for a batch size of 1.
请注意,根据 this issue 我刚刚打开的内容,我们希望减少混淆。
我知道 webjob 随 webapp 扩展,即如果我的 webapp 在 5 个实例上 运行ning,那么 webjobs 也会在 5 个实例上 运行。 我只想知道是否有办法在网站的每个实例中拥有多个 webjob 实例。
注意:我已经有了 JobHostConfiguration.QueuesConfiguration.BatchSize = 32 的最大值。
现在,我的网络应用 运行正在 1 个实例上运行。 Webjobs 正在同时处理 32 个。 我的目标是同时处理 3*32 = 96 个。
实现此目标的一种可能方法是部署相同的 webjobs 3 次(为 webJobName 属性 设置不同的名称),但我不确定这是否是一个好的做法。请指出适当的文档。
config.Queues.NewBatchThreshold表示什么?
config.Queues.NewBatchThreshold的默认值是多少?
对于队列处理,config.Queues.NewBatchThreshold 的推荐值应该是多少?
正在从 https://github.com/Azure/azure-webjobs-sdk/issues/628 复制 Jon 的回答:
The NewBatchThreshold is the number of messages to have left to process in the batch before the SDK refreshes the batch.
For example, if your batch size is 20 and NewBatchThreshold is 5, the SDK will grab 20 messages off the queue each time, pass them to your code for you to process them one by one, then when it gets down to the last 5 unprocessed messages (so you've processed 15) it will grab the next 20. See here under "Parallel execution"
By default the NewBatchThreshold is half of BatchSize (see source code) which is why you are seeing a value of 0 for a batch size of 1.
请注意,根据 this issue 我刚刚打开的内容,我们希望减少混淆。