Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): Align concurrency and timeout defaults between instance and runner #12503

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/@n8n/config/src/configs/runners.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class TaskRunnersConfig {
/**
* How many concurrent tasks can a runner execute at a time
*
* @note Kept high for backwards compatibility - n8n v2 will reduce this to `5`
* Kept high for backwards compatibility - n8n v2 will reduce this to `5`
*/
@Env('N8N_RUNNERS_MAX_CONCURRENCY')
maxConcurrency: number = 10;
Expand All @@ -52,7 +52,7 @@ export class TaskRunnersConfig {
* 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`
* Kept high for backwards compatibility - n8n v2 will reduce this to `60`
*/
@Env('N8N_RUNNERS_TASK_TIMEOUT')
taskTimeout: number = 300; // 5 minutes
Expand Down
16 changes: 14 additions & 2 deletions packages/@n8n/task-runner/src/config/base-runner-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,13 @@ export class BaseRunnerConfig {
@Env('N8N_RUNNERS_MAX_PAYLOAD')
maxPayloadSize: number = 1024 * 1024 * 1024;

/**
* How many concurrent tasks can a runner execute at a time
*
* Kept high for backwards compatibility - n8n v2 will reduce this to `5`
*/
@Env('N8N_RUNNERS_MAX_CONCURRENCY')
maxConcurrency: number = 5;
maxConcurrency: number = 10;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the reason to define these a second time? could we delete these, and use TaskRunnersConfig from the config package instead?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Task runner and n8n are two separate executables. It feels a weird to share the same configuration between them, especially since the configuration items they use are not 1:1. What we could do is to extract the shared parts into its own class and share that between n8n and task runner.


/**
* How long (in seconds) a runner may be idle for before exit. Intended
Expand All @@ -37,8 +42,15 @@ export class BaseRunnerConfig {
@Env('GENERIC_TIMEZONE')
timezone: string = 'America/New_York';

/**
* 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.
*
* 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

@Nested
healthcheckServer!: HealthcheckServerConfig;
Expand Down
Loading