From 1c73490dc3186af3546e1bca17113007dbb045ef Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Mon, 14 Aug 2023 01:05:18 +0200 Subject: [PATCH] perf: reduce the worker_threads pool size in hybrid examples MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- examples/typescript/http-server-pool/fastify-hybrid/src/main.ts | 2 +- examples/typescript/websocket-server-pool/ws-hybrid/src/main.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/typescript/http-server-pool/fastify-hybrid/src/main.ts b/examples/typescript/http-server-pool/fastify-hybrid/src/main.ts index ca7c42d4..5fc7542b 100644 --- a/examples/typescript/http-server-pool/fastify-hybrid/src/main.ts +++ b/examples/typescript/http-server-pool/fastify-hybrid/src/main.ts @@ -22,7 +22,7 @@ const pool = new FixedClusterPool( .execute({ port: 8080, workerFile: requestHandlerWorkerFile, - maxWorkers: Math.round(availableParallelism() / 2), + maxWorkers: Math.round(availableParallelism() / 4), enableTasksQueue: true, tasksQueueOptions: { concurrency: 8 diff --git a/examples/typescript/websocket-server-pool/ws-hybrid/src/main.ts b/examples/typescript/websocket-server-pool/ws-hybrid/src/main.ts index 62e772da..b9e48bdd 100644 --- a/examples/typescript/websocket-server-pool/ws-hybrid/src/main.ts +++ b/examples/typescript/websocket-server-pool/ws-hybrid/src/main.ts @@ -21,7 +21,7 @@ const pool = new FixedClusterPool( pool .execute({ port: 8080, - maxWorkers: Math.round(availableParallelism() / 2), + maxWorkers: Math.round(availableParallelism() / 4), workerFile: requestHandlerWorkerFile, enableTasksQueue: true, tasksQueueOptions: { -- 2.34.1