I have an existing PM2 process that I would like to add the "--max-memory-restart" setting to. How can I do that? The process was created from the command line without a JSON file.
If I were creating a new process I would just run:
PM2 start [process name] --max-memory-restart 700M
or whatever
How can I do the same for an existing process? How can I confirm that it works?
Thanks!
In console : pm2 save --First make sure that you saved correctly all your processes. npm install pm2 -g --Then install the latest PM2 version from NPM. pm2 update --And finally update the in-memory PM2 process.
Restart on file change To totally disable the watch feature, do: pm2 stop app --watch or toggle the watch option on application restart via pm2 restart app --watch .
pm2 runs the process in background as daemon, You can see the logs for individual process using pm2 logs < process_id >. You can not make changes to running process. You can instead allow pm2 to listen to file changes and live-reload the process.
To change your existing PM2 process. you can use this command:
pm2 restart [existing name] --max-memory-restart 700M
To check if it affect or not, you can set it with low memory to restart (like 30M). Then check restart time by : pm2 ls
command.
Sorry for my bad English. Hope it help.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With