javascript - Node JS pm2 maximum memory limit -
i'm using pm2 , node js. want set maximum memory limit application. dev server's limit 500mb split between 2 applications. ideally limit 200mb. need limit hard limit application, , not restart application if exceeds pm2 command "max_memory_restart" does. i've tried use --max_old_space_size command no luck. there way this?
example pm2 json file
{ "apps": [ { "name": "sample", "script": "runit.js", "watch": false, "cwd": "xxxxxx", "env": { "node_tls_reject_unauthorized": '0', "node_env": "local_public", "port": 3000, "proxy_port": 4000, }, "args": [ "--max_old_space_size=200" ] } ] }
i used pm2 directly run node.js scripts , code works me:
pm2 start file.js --max-memory-restart 100m hope max-memory-restart argument works you
Comments
Post a Comment