Heroku:为 node.js 设置环境变量 WEB_MEMORY

Heroku: set environment variable WEB_MEMORY for node.js

我可以在这里阅读:https://devcenter.heroku.com/articles/node-concurrency#tuning-the-concurrency-level 内存管理

The Heroku buildpack provides reasonable defaults through two environment variables: WEB_MEMORY and WEB_CONCURRENCY. Both of these can be overridden

但他们没有说明如何覆盖它们。我试过了

process.env['WEB_MEMORY'] = 1024;

在我的 app.js 文件中,但是当我推送到 Heroku 时,我仍然得到

512 MB limit per process (WEB_MEMORY)

如何覆盖这个 WEB_MEMORY 变量?

heroku config:set WEB_MEMORY=unicorns --app YOUR_APP_NAME

参见:https://devcenter.heroku.com/articles/config-vars