aws-samples / aws-samples/eb-node-express-sample

Increase resilience and simplify the implementation

Abierto
#4 0 comentarios 1 reacción 0 asignados Ver en GitHub
Lenguaje dominante
EJS
Estrellas
279
Forks
247
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

I have a suggestion to improve the resilience and align a bit more with industry standards.

You should **not** be doing clustering in your code. I adds noise and is right now preventing the script from running unclustered. There are pretty sweet tools to manage your process, bring it back up when it crashes, monitor it and finally cluster it. Tools like [PM2](https://github.com/Unitech/pm2)

What I suggest is to:
- add the `pm2` dependency to the `package.json`
- remove the clustering logic from `app.js`
- change the `npm start` command for `pm2 start app.js -i max` where `max` can easily be changed to any number to define the number of clusters to make.

PM2 also has the advantage to be hookable for remote monitoring with almost no effort, which could be interesting for this project.

Cheers

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Empieza leyendo package.json y app.js para entender el comando de inicio actual y la lógica de clustering. Compara la configuración de PM2 solicitada con el comportamiento existente del proceso y, después, verifica que npm start inicie el ejemplo como se especifica y que el clustering ya no se gestione en app.js.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
express, node.js
Área
backend, devops
Tipo de issue
Refactorización
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bien especificado
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.