perf: reduce the worker_threads pool size in hybrid examples
authorJérôme Benoit <jerome.benoit@sap.com>
Sun, 13 Aug 2023 23:05:18 +0000 (01:05 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Sun, 13 Aug 2023 23:05:18 +0000 (01:05 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
examples/typescript/http-server-pool/fastify-hybrid/src/main.ts
examples/typescript/websocket-server-pool/ws-hybrid/src/main.ts

index ca7c42d4b6c59c626235d9cc50821446a86db95f..5fc7542b7779df64a0f0aeab87ecc1ac13220246 100644 (file)
@@ -22,7 +22,7 @@ const pool = new FixedClusterPool<ClusterWorkerData, ClusterWorkerResponse>(
         .execute({
           port: 8080,
           workerFile: requestHandlerWorkerFile,
-          maxWorkers: Math.round(availableParallelism() / 2),
+          maxWorkers: Math.round(availableParallelism() / 4),
           enableTasksQueue: true,
           tasksQueueOptions: {
             concurrency: 8
index 62e772da7bf34d4f808ef56e037f814dea16fc46..b9e48bdd2ee194abf47d6d1b69eddd3dc134100d 100644 (file)
@@ -21,7 +21,7 @@ const pool = new FixedClusterPool<ClusterWorkerData, ClusterWorkerResponse>(
       pool
         .execute({
           port: 8080,
-          maxWorkers: Math.round(availableParallelism() / 2),
+          maxWorkers: Math.round(availableParallelism() / 4),
           workerFile: requestHandlerWorkerFile,
           enableTasksQueue: true,
           tasksQueueOptions: {