mirror of
https://github.com/outline/outline.git
synced 2025-12-21 10:39:41 -06:00
perf: Increase default concurrency on worker
This commit is contained in:
@@ -406,6 +406,24 @@ export class Environment {
|
||||
environment.SOURCE_COMMIT || environment.SOURCE_VERSION
|
||||
);
|
||||
|
||||
/**
|
||||
* The maximum number of concurrent events processed per-worker. To get total
|
||||
* concurrency you should multiply this by the number of workers.
|
||||
*/
|
||||
@IsOptional()
|
||||
@IsNumber()
|
||||
public WORKER_CONCURRENCY_EVENTS =
|
||||
this.toOptionalNumber(environment.WORKER_CONCURRENCY_EVENTS) ?? 10;
|
||||
|
||||
/**
|
||||
* The maximum number of concurrent tasks processed per-worker. To get total
|
||||
* concurrency you should multiply this by the number of workers.
|
||||
*/
|
||||
@IsOptional()
|
||||
@IsNumber()
|
||||
public WORKER_CONCURRENCY_TASKS =
|
||||
this.toOptionalNumber(environment.WORKER_CONCURRENCY_TASKS) ?? 10;
|
||||
|
||||
/**
|
||||
* A boolean switch to toggle the rate limiter at application web server.
|
||||
*/
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import env from "@server/env";
|
||||
import Logger from "@server/logging/Logger";
|
||||
import { setResource, addTags } from "@server/logging/tracer";
|
||||
import { traceFunction } from "@server/logging/tracing";
|
||||
@@ -18,6 +19,7 @@ export default function init() {
|
||||
// This queue processes the global event bus
|
||||
globalEventQueue
|
||||
.process(
|
||||
env.WORKER_CONCURRENCY_EVENTS,
|
||||
traceFunction({
|
||||
serviceName: "worker",
|
||||
spanName: "process",
|
||||
@@ -79,6 +81,7 @@ export default function init() {
|
||||
// as unapplicable events were filtered in the global event queue above.
|
||||
processorEventQueue
|
||||
.process(
|
||||
env.WORKER_CONCURRENCY_EVENTS,
|
||||
traceFunction({
|
||||
serviceName: "worker",
|
||||
spanName: "process",
|
||||
@@ -123,6 +126,7 @@ export default function init() {
|
||||
// Jobs for async tasks are processed here.
|
||||
taskQueue
|
||||
.process(
|
||||
env.WORKER_CONCURRENCY_TASKS,
|
||||
traceFunction({
|
||||
serviceName: "worker",
|
||||
spanName: "process",
|
||||
|
||||
Reference in New Issue
Block a user