feat(models): implement model.max_concurrency for background tasks

Add a new `max_concurrency` setting to the model configuration, allowing for fine-tuned control over the maximum number of concurrent background tasks (ingestion/enrichment) per model. This update includes localization support across multiple languages and integrates the setting into the system's concurrency governor, enabling immediate application of changes without requiring a service restart.
This commit is contained in:
wizardchen
2026-07-09 20:36:02 +08:00
committed by lyingbug
parent 20256287ec
commit 4404ea74e3
6 changed files with 77 additions and 0 deletions
+7
View File
@@ -3471,6 +3471,9 @@ export default {
asynq: {
concurrency: 'Async task worker concurrency',
},
model: {
max_concurrency: 'Default per-model concurrency limit',
},
},
keyDescriptions: {
auth: {
@@ -3491,6 +3494,10 @@ export default {
concurrency:
'Async task worker concurrency (asynq thread-pool size). Document parsing, embedding, and similar tasks are mostly I/O-bound, so raising this value can shorten queue time for bulk uploads. Requires a service process restart to take effect.',
},
model: {
max_concurrency:
'Default cap on concurrent background (ingestion/enrichment) calls to a single model, keyed by model ID and shared across replicas. Read on every call and applied immediately with no restart. 0 or a negative value disables the default cap (each model still honours its own limit configured in model management). Affects background tasks only, not interactive chat.',
},
},
enumLabels: {
auth: {
+7
View File
@@ -2476,6 +2476,9 @@ export default {
asynq: {
concurrency: "비동기 작업 워커 동시 처리 수",
},
model: {
max_concurrency: "모델 기본 동시 처리 상한",
},
},
keyDescriptions: {
auth: {
@@ -2496,6 +2499,10 @@ export default {
concurrency:
"비동기 작업 worker 동시 처리 수(asynq 스레드 풀 크기)입니다. 문서 파싱·임베딩 등은 대부분 I/O 대기이므로 값을 올리면 대량 업로드 대기 시간을 줄일 수 있습니다. 적용하려면 서비스 프로세스를 재시작해야 합니다.",
},
model: {
max_concurrency:
"백그라운드 작업(문서 색인/보강)이 단일 모델에 대해 갖는 기본 동시 호출 상한이며, 모델 ID 기준으로 모든 복제본이 공유합니다. 매 호출마다 실시간으로 읽고 재시작 없이 즉시 적용됩니다. 0 또는 음수는 기본 상한을 해제합니다(각 모델은 모델 관리에서 설정한 자체 상한을 계속 준수함). 백그라운드 작업에만 영향을 주며 대화형 채팅에는 영향을 주지 않습니다.",
},
},
enumLabels: {
auth: {
+7
View File
@@ -2174,6 +2174,9 @@ export default {
asynq: {
concurrency: 'Параллелизм воркеров асинхронных задач',
},
model: {
max_concurrency: 'Лимит параллелизма модели по умолчанию',
},
},
keyDescriptions: {
auth: {
@@ -2194,6 +2197,10 @@ export default {
concurrency:
'Параллелизм воркеров асинхронных задач (размер пула потоков asynq). Парсинг документов, эмбеддинги и подобные задачи в основном ждут I/O, поэтому увеличение значения сокращает очередь при массовой загрузке. Для применения требуется перезапуск процесса сервиса.',
},
model: {
max_concurrency:
'Лимит по умолчанию на количество одновременных фоновых вызовов (индексация/обогащение) к одной модели, привязанный к ID модели и общий для всех реплик. Читается при каждом вызове и применяется сразу без перезапуска. 0 или отрицательное значение отключает лимит по умолчанию (каждая модель всё равно соблюдает собственный лимит, заданный в управлении моделями). Влияет только на фоновые задачи, не на интерактивный чат.',
},
},
enumLabels: {
auth: {
+9
View File
@@ -2479,6 +2479,9 @@ export default {
asynq: {
concurrency: "异步任务并发数",
},
model: {
max_concurrency: "模型默认并发上限",
},
},
keyDescriptions: {
auth: {
@@ -2506,6 +2509,12 @@ export default {
"文档解析、嵌入等任务多为 I/O 等待,适当提高可缩短批量上传排队时间。" +
"修改后需重启服务进程方可生效。",
},
model: {
max_concurrency:
"后台任务(文档入库/富化)对单个模型的默认并发上限,按模型 ID 全副本共享。" +
"每次调用实时读取,修改后立即生效、无需重启。0 或负数表示关闭默认限制" +
"(各模型仍会尊重自身在模型管理里配置的上限)。仅影响后台任务,不影响交互式对话。",
},
},
enumLabels: {
auth: {