aws-samples / aws-samples/eb-node-express-sample
Increase resilience and simplify the implementation
- Langage dominant
- EJS
- Étoiles
- 279
- Forks
- 247
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
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
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Commencez par lire package.json et app.js afin de comprendre la commande de démarrage actuelle et la logique de clustering. Comparez la configuration PM2 demandée avec le comportement actuel du processus, puis vérifiez que npm start lance l’exemple comme indiqué et que le clustering n’est plus géré dans app.js.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- express, node.js
- Domaine
- backend, devops
- Type d'issue
- Refactorisation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- Clairement spécifiée
- Accessibilité débutants
- 35/100