perf(worker): 缩短异步批量填槽延迟
将单次异步准入准备批次限制为 8 个任务,使双节点调度器以多个短事务批次渐进填满全局容量,避免准备 48 个媒体任务后才首次提交造成的长时间冷启动空槽。\n\n验证:Go 全量测试、go vet、runner/store race、gofmt、迁移安全检查通过。
This commit is contained in:
@@ -33,6 +33,7 @@ const (
|
||||
asyncWorkerCapacityScopeKey = "global"
|
||||
asyncWorkerQueueLimit = 10000
|
||||
asyncWorkerMaxWaitSeconds = 24 * 60 * 60
|
||||
asyncAdmissionBatchMax = 8
|
||||
acceptanceQueueLimit = 10000
|
||||
acceptanceQueueMaxWait = 15 * 60
|
||||
synchronousAdmissionWakeMax = 256
|
||||
@@ -707,8 +708,8 @@ func (s *Service) dispatchWaitingAsyncAdmissions(ctx context.Context) {
|
||||
if batchLimit <= 0 {
|
||||
batchLimit = 64
|
||||
}
|
||||
if batchLimit > 128 {
|
||||
batchLimit = 128
|
||||
if batchLimit > asyncAdmissionBatchMax {
|
||||
batchLimit = asyncAdmissionBatchMax
|
||||
}
|
||||
taskIDs, err := s.store.ListWaitingAsyncAdmissionTaskIDs(ctx, batchLimit)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user