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

Increase resilience and simplify the implementation

Đang mở
#4 0 bình luận 1 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
EJS
Star
279
Fork
247
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu bằng cách đọc package.json và app.js để hiểu lệnh start hiện tại và logic clustering. So sánh thiết lập PM2 được yêu cầu với hành vi hiện tại của tiến trình, sau đó xác minh rằng npm start khởi chạy sample như đã chỉ định và clustering không còn được xử lý trong app.js.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
express, node.js
Lĩnh vực
backend, devops
Loại issue
Tái cấu trúc
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Đặc tả rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.