Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

192
Vistas
Can I have multiple event loop in nodejs microservices?

I Have 4 Microservices, named "auth_ms","coin_ms","device_ms" and setting_ms. I'm running all 4 Microservices on different ports, for example: 3000, 3001, 3002 and 3003.

My Question: By running these 4 servers on different port, do we have 4 event-loops ? if NOT, then if I put it in Docker containers does it have 4 event-loops? Suppose there is only 1 event loop for everything then how does microservices help in processing?

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

When you write node index.js in the terminal you are creating a NodeJS process, which contains all of the goodies of node, including the event loop.

Assuming your microservices run in separate node instances, then you will have an event loop for every one of your instances of node. And it does not matter if it's in docker or not as long as there are separate processes running.

Now, if there is only one OS process, then only one action can be performed at a time. And worse yet, if you run it on multi-core machine, only one of the cores will be used, wasting all of the potential resources that can be utilized for processing. For this reason in production environment I usually run container for every vCPU there is available.

So what you want to have is - separate processes for every service you have (separate docker containers also count) and the rest will be handled by the system.

about 4 years ago · Juan Pablo Isaza Denunciar

0

Each of your microservices are running as different processes locally, so they will have separate event-loops. This also applies to Docker containers, where the services will be completely isolated.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda