From: Jérôme Benoit Date: Mon, 14 Aug 2023 00:09:47 +0000 (+0200) Subject: fix: fix pool sizing in examples X-Git-Tag: v2.6.26~40 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=58399427588adb63380e6bfe955dbdf4ea8ea8a5;p=poolifier.git fix: fix pool sizing in examples Signed-off-by: Jérôme Benoit --- 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 5fc7542b..d840dfb9 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,10 @@ const pool = new FixedClusterPool( .execute({ port: 8080, workerFile: requestHandlerWorkerFile, - maxWorkers: Math.round(availableParallelism() / 4), + maxWorkers: + Math.round(availableParallelism() / 4) < 1 + ? 1 + : 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 b9e48bdd..5cfbbf43 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,10 @@ const pool = new FixedClusterPool( pool .execute({ port: 8080, - maxWorkers: Math.round(availableParallelism() / 4), + maxWorkers: + Math.round(availableParallelism() / 4) < 1 + ? 1 + : Math.round(availableParallelism() / 4), workerFile: requestHandlerWorkerFile, enableTasksQueue: true, tasksQueueOptions: {