首页 > 解决方案 > 使用 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
    }
  ]
}

标签: node.jsexpressjenkinsibm-clouddevops

解决方案


推荐阅读