Skip to content

Commit

Permalink
fix(core): Increase default concurrency and timeout in task runners (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ivov authored Jan 8, 2025
1 parent 3654861 commit 4182095
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
20 changes: 15 additions & 5 deletions packages/@n8n/config/src/configs/runners.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/** 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. */
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.
*
* @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')
Expand Down
4 changes: 2 additions & 2 deletions packages/@n8n/config/test/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ describe('GlobalConfig', () => {
maxPayload: 1024 * 1024 * 1024,
port: 5679,
maxOldSpaceSize: '',
maxConcurrency: 5,
taskTimeout: 60,
maxConcurrency: 10,
taskTimeout: 300,
heartbeatInterval: 30,
},
sentry: {
Expand Down

0 comments on commit 4182095

Please # to comment.