From 4182095af1c02832af2523f31e9cb85d9a345e60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Wed, 8 Jan 2025 11:25:37 +0100 Subject: [PATCH] fix(core): Increase default concurrency and timeout in task runners (#12496) --- .../@n8n/config/src/configs/runners.config.ts | 18 ++++++++++++++---- packages/@n8n/config/test/config.test.ts | 4 ++-- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/packages/@n8n/config/src/configs/runners.config.ts b/packages/@n8n/config/src/configs/runners.config.ts index 733e724408..f41f3e101e 100644 --- a/packages/@n8n/config/src/configs/runners.config.ts +++ b/packages/@n8n/config/src/configs/runners.config.ts @@ -39,13 +39,23 @@ export class TaskRunnersConfig { @Env('N8N_RUNNERS_MAX_OLD_SPACE_SIZE') maxOldSpaceSize: string = ''; - /** How many concurrent tasks can a runner execute at a time */ + /** + * How many concurrent tasks can a runner execute at a time + * + * @note Kept high for backwards compatibility - n8n v2 will reduce this to `5` + */ @Env('N8N_RUNNERS_MAX_CONCURRENCY') - maxConcurrency: number = 5; + maxConcurrency: number = 10; - /** How long (in seconds) a task is allowed to take for completion, else the task will be aborted. (In internal mode, the runner will also be restarted.) Must be greater than 0. */ + /** + * How long (in seconds) a task is allowed to take for completion, else the + * task will be aborted. (In internal mode, the runner will also be + * restarted.) Must be greater than 0. + * + * @note Kept high for backwards compatibility - n8n v2 will reduce this to `60` + */ @Env('N8N_RUNNERS_TASK_TIMEOUT') - taskTimeout: number = 60; + taskTimeout: number = 300; // 5 minutes /** How often (in seconds) the runner must send a heartbeat to the broker, else the task will be aborted. (In internal mode, the runner will also be restarted.) Must be greater than 0. */ @Env('N8N_RUNNERS_HEARTBEAT_INTERVAL') diff --git a/packages/@n8n/config/test/config.test.ts b/packages/@n8n/config/test/config.test.ts index 9fd0a35d5a..ed386fee6b 100644 --- a/packages/@n8n/config/test/config.test.ts +++ b/packages/@n8n/config/test/config.test.ts @@ -229,8 +229,8 @@ describe('GlobalConfig', () => { maxPayload: 1024 * 1024 * 1024, port: 5679, maxOldSpaceSize: '', - maxConcurrency: 5, - taskTimeout: 60, + maxConcurrency: 10, + taskTimeout: 300, heartbeatInterval: 30, }, sentry: {