From ffd12d0539785ccb9d51bd7423abeb529f95d4e0 Mon Sep 17 00:00:00 2001 From: tamaina Date: Wed, 17 Jul 2024 18:36:04 +0900 Subject: [PATCH] deliverJobConcurrency: 16, deliverJobPerSec: 1024, inboxJobConcurrency: 4 --- .config/docker_example.yml | 4 ++-- .config/example.yml | 6 +++--- .devcontainer/devcontainer.yml | 6 +++--- chart/files/default.yml | 6 +++--- packages/backend/src/core/HttpRequestService.ts | 2 +- packages/backend/src/queue/QueueProcessorService.ts | 6 +++--- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.config/docker_example.yml b/.config/docker_example.yml index d347882d1a..985ba989c4 100644 --- a/.config/docker_example.yml +++ b/.config/docker_example.yml @@ -164,8 +164,8 @@ id: 'aidx' #clusterLimit: 1 # Job concurrency per worker -# deliverJobConcurrency: 128 -# inboxJobConcurrency: 16 +# deliverJobConcurrency: 16 +# inboxJobConcurrency: 4 # Job rate limiter # deliverJobPerSec: 128 diff --git a/.config/example.yml b/.config/example.yml index b11cbd1373..54f21aa0f9 100644 --- a/.config/example.yml +++ b/.config/example.yml @@ -230,14 +230,14 @@ id: 'aidx' #clusterLimit: 1 # Job concurrency per worker -#deliverJobConcurrency: 128 -#inboxJobConcurrency: 16 +#deliverJobConcurrency: 16 +#inboxJobConcurrency: 4 #relationshipJobConcurrency: 16 # What's relationshipJob?: # Follow, unfollow, block and unblock(ings) while following-imports, etc. or account migrations. # Job rate limiter -#deliverJobPerSec: 128 +#deliverJobPerSec: 1024 #inboxJobPerSec: 32 #relationshipJobPerSec: 64 diff --git a/.devcontainer/devcontainer.yml b/.devcontainer/devcontainer.yml index beefcfd0a2..42c81588d6 100644 --- a/.devcontainer/devcontainer.yml +++ b/.devcontainer/devcontainer.yml @@ -157,11 +157,11 @@ id: 'aidx' #clusterLimit: 1 # Job concurrency per worker -# deliverJobConcurrency: 128 -# inboxJobConcurrency: 16 +# deliverJobConcurrency: 16 +# inboxJobConcurrency: 4 # Job rate limiter -# deliverJobPerSec: 128 +# deliverJobPerSec: 1024 # inboxJobPerSec: 32 # Job attempts diff --git a/chart/files/default.yml b/chart/files/default.yml index f98b8ebfee..7606238048 100644 --- a/chart/files/default.yml +++ b/chart/files/default.yml @@ -178,11 +178,11 @@ id: "aidx" #clusterLimit: 1 # Job concurrency per worker -# deliverJobConcurrency: 128 -# inboxJobConcurrency: 16 +# deliverJobConcurrency: 16 +# inboxJobConcurrency: 4 # Job rate limiter -# deliverJobPerSec: 128 +# deliverJobPerSec: 1024 # inboxJobPerSec: 32 # Job attempts diff --git a/packages/backend/src/core/HttpRequestService.ts b/packages/backend/src/core/HttpRequestService.ts index 7f3cac7c58..4249c158d7 100644 --- a/packages/backend/src/core/HttpRequestService.ts +++ b/packages/backend/src/core/HttpRequestService.ts @@ -70,7 +70,7 @@ export class HttpRequestService { localAddress: config.outgoingAddress, }); - const maxSockets = Math.max(256, config.deliverJobConcurrency ?? 128); + const maxSockets = Math.max(256, config.deliverJobConcurrency ?? 16); this.httpAgent = config.proxy ? new HttpProxyAgent({ diff --git a/packages/backend/src/queue/QueueProcessorService.ts b/packages/backend/src/queue/QueueProcessorService.ts index 7bd74f3210..df56391e9e 100644 --- a/packages/backend/src/queue/QueueProcessorService.ts +++ b/packages/backend/src/queue/QueueProcessorService.ts @@ -250,9 +250,9 @@ export class QueueProcessorService implements OnApplicationShutdown { }, { ...baseQueueOptions(this.config, QUEUE.DELIVER), autorun: false, - concurrency: this.config.deliverJobConcurrency ?? 128, + concurrency: this.config.deliverJobConcurrency ?? 16, limiter: { - max: this.config.deliverJobPerSec ?? 128, + max: this.config.deliverJobPerSec ?? 1024, duration: 1000, }, settings: { @@ -290,7 +290,7 @@ export class QueueProcessorService implements OnApplicationShutdown { }, { ...baseQueueOptions(this.config, QUEUE.INBOX), autorun: false, - concurrency: this.config.inboxJobConcurrency ?? 16, + concurrency: this.config.inboxJobConcurrency ?? 4, limiter: { max: this.config.inboxJobPerSec ?? 32, duration: 1000,