与Heroku的巢:错误R15(大大超出内存配额)

qco9c6ql  于 2022-11-13  发布在  其他
关注(0)|答案(1)|浏览(95)

我在heroku上使用Nestjs技术成功部署了一个后端应用程序。然后我将twilio服务添加到项目中以发送短信,但部署不再工作。在控制台中,我收到错误消息:
进程运行mem= 973 M(190.2%)错误R14(超出内存配额)停止所有进程,SIGTERM进程退出,状态为143
我尝试了几种解决方案都没有成功,其中包括以下命令:heroku配置:设置节点选项="--最大旧空间大小=2560”

这是我的包的内容。json

{
  ......

  "scripts": {
    "prebuild": "rimraf dist",
    "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
    "start": "nest start",
    "build": "nest build",
    "start:dev": "nest start --watch",
    "start:debug": "nest start --debug --watch",
    "start:prod": "node dist/main",
    "lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
    "test": "jest",
    "test:watch": "jest --watch",
    "test:cov": "jest --coverage",
    "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
    "test:e2e": "jest --config ./test/jest-e2e.json",
    "typeorm": "node --require ts-node/register ./node_modules/typeorm/cli.js --config src/utils/ormconfig.ts",
    "migration:generate": "npm run build && npm run typeorm migration:generate -- -n db",
    "migration:run": "npm run build && npm run typeorm migration:run"
    },
  "dependencies": {
    "@nestjs/cli": "^9.1.4",
    "@nestjs/common": "^9.1.4",
    "@nestjs/config": "^2.2.0",
    "@nestjs/core": "^9.1.4",
    "@nestjs/jwt": "^9.0.0",
    "@nestjs/mapped-types": "*",
    "@nestjs/passport": "^9.0.0",
    "@nestjs/platform-express": "^9.1.4",
    "@nestjs/platform-socket.io": "^9.1.4",
    "@nestjs/swagger": "^6.1.2",
    "@nestjs/typeorm": "^9.0.1",
    "@nestjs/websockets": "^9.1.4",
    "@types/socket.io": "^3.0.2",
    "aws-node-sns": "^0.0.3",
    "aws-sdk": "^2.1241.0",
    "bcrypt": "^5.1.0",
    "class-transformer": "^0.5.1",
    "class-validator": "^0.13.2",
    "firebase-admin": "^11.1.0",
    "kkiapay-nodejs-sdk": "github:kkiapay/nodejs-sdk",
    "passport": "^0.6.0",
    "passport-headerapikey": "^1.2.2",
    "passport-jwt": "^4.0.0",
    "passport-local": "^1.0.0",
    "pg": "^8.8.0",
    "reflect-metadata": "^0.1.13",
    "rimraf": "^3.0.2",
    "rxjs": "^7.5.7",
    "swagger-ui-express": "^4.5.0",
    "typeorm": "^0.3.10"
  },
  "devDependencies": {
    "@nestjs/schematics": "^9.0.3",
    "@nestjs/testing": "^9.1.4",
    "@types/bcrypt": "^5.0.0",
    "@types/dotenv": "^8.2.0",
    "@types/express": "^4.17.14",
    "@types/jest": "29.1.2",
    "@types/node": "^18.11.0",
    "@types/passport-jwt": "^3.0.7",
    "@types/passport-local": "^1.0.34",
    "jest": "29.2.0",
    "prettier": "^2.7.1",
    "source-map-support": "^0.5.21",
    "supertest": "^6.3.0",
    "ts-jest": "29.0.3",
    "ts-loader": "^9.4.1",
    "ts-node": "^10.9.1",
    "tsconfig-paths": "4.1.0",
    "typescript": "^4.8.4"
  },

  .....

  "engines": {
    "node": "16.14.0",
    "npm": "8.5.2"
  }
}
ccgok5k5

ccgok5k51#

Heroku dynos(免费、业余和标准1x)的最大内存为512 MB(https://devcenter.heroku.com/articles/limits#dynos)。Twilio服务似乎需要更多资源。

相关问题