aws-samples / aws-samples/eb-node-express-sample
Increase resilience and simplify the implementation
- Vorherrschende Sprache
- EJS
- Sterne
- 279
- Forks
- 247
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
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
Beitragsleitfaden
Rechercherichtung
Beginne damit, package.json und app.js zu lesen, um den aktuellen start-Befehl und die Clustering-Logik zu verstehen. Vergleiche die angeforderte PM2-Konfiguration mit dem bestehenden Prozessverhalten und überprüfe anschließend, dass npm start das Beispiel wie angegeben startet und dass das Clustering nicht mehr in app.js behandelt wird.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- express, node.js
- Bereich
- backend, devops
- Issue-Typ
- Refactoring
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Klar beschrieben
- Anfängerfreundlichkeit
- 35/100