node.js - 使用 Bluemix 自动缩放和 Node.js 集群方法的最佳实践是什么
问题描述
我已将简单的 Node.js/Express 应用程序更改为使用集群模块: https ://rowanmanning.com/posts/node-cluster-and-express/
它适用于我的本地。现在,如果我将它部署到云端会怎样?应该如何调整 autoscaling.json 和 manifest.yml 文件,使其不与多线程实现冲突?
清单.yml
---
applications:
- name: my service
host: xxxxxxxxxx
memory: 512M
path: ../../.
timeout: 180
instances: 3
disk_quota: 1024M
自动缩放.json
{
"instanceMaxCount": 5,
"instanceMinCount": 3,
"policyTriggers": [
{
"breachDuration": 600,
"instanceStepCountDown": 1,
"instanceStepCountUp": 1,
"lowerThreshold": 35,
"metricType": "Memory",
"statWindow": 300,
"stepDownCoolDownSecs": 600,
"stepUpCoolDownSecs": 600,
"upperThreshold": 70
}
]
}
解决方案
推荐阅读
- coordinates - 如何创建在一定程度上适合 OpenLayers5 的自定义图块
- python - 无法从“rest_framework.decorators”导入名称“detail_route”
- coldfusion - 在 ColdFusion 中默认日期字段
- javascript - JavaScript 函数:在函数的输入 Str 中将第一个字母和 _ 之后的所有字母大写
- if-statement - 如何结合 ARRAYFORMULA 和 COUNTIF
- javascript - 您如何在 xero-node 库中通过联系人获取老化的应收账款?
- mysql - 执行 substring_index 查询
- python - 如何在 django 模板的主页中显示简短版本的帖子
- php - 如何从中间代理调用和获取 API 响应?
- sql-server - 如何在 ssis 中将 dt_date yyyy-mm-dd 转换为 dt_date yyyy/MM/dd?