---
title: "Ezequiel Regaldo (@Swarow) | Hashnode"
description: "Im a software developer. Learning new things everyday. Read the latest articles by Ezequiel Regaldo on Hashnode."
url: "https://hashnode.com/@Swarow"
---

@Swarow

# Ezequiel Regaldo

@Swarow · Joined August 2024

Im a software developer. Learning new things everyday.

## Comments

[Hi Klaus, first of all, welcome to JS/TS world ! Please let me suggest something to your code, if you're using multiple cores, for each 4 cores, spawn a node cluster to improve significantly the ammount of requests. For example: /////// File : cluster.service.ts import as cluster from "cluster"; import as process from "node:process"; const numOfClusters = 4; // Im using 16 cores @Injectable() export class ClusterService { static clusterize(callback: Function): void { if (cluster.isMaster) { console.log(MASTER SERVER (${process.pid}) IS RUNNING); for (let i = 0; i < numOfClusters; i++) { cluster.fork(); } cluster.on("exit", (worker, code, signal) => { console.log(worker ${worker.process.pid} died); }); } else { callback(); } } } /////// File : main.ts import { NestFactory } from '@nestjs/core'; import { AppModule } from './app.module'; import { ClusterService } from './cluster/cluster.service'; import { FastifyAdapter, NestFastifyApplication } from '@nestjs/platform-fastify'; async function bootstrap() { const app = await NestFactory.create( AppModule, new FastifyAdapter() ); await app.listen(3000, '127.0.0.1'); } ClusterService.clusterize(bootstrap) /////// Conclusion : I tested this in bare metal and docker containers and i get 20% ~ 40% more requests than spring boot equivalent. Im really surprised how nodejs can handle too many requests with minimal effort](https://hashnode.com/posts/advanced-project-setup-with-nestjs-and-typescript/661d21b44b8894528066e727/comment/66d1d26f9a966ceb2271fa37)

Comment · Article · Aug 30, 2024 · [Advanced project setup with Nest.js and Typescript](https://hashnode.com/posts/advanced-project-setup-with-nestjs-and-typescript/661d21b44b8894528066e727)
