npm and node_index.js high CPU load

Having issues with your DietPi installation or found a bug? Post it here.
User avatar
Joulinar
Posts: 5109
Joined: Sat Nov 16, 2019 12:49 am

Re: npm and node_index.js high CPU load

Post by Joulinar »

that's all? looks like it is not starting correctly. can you do a reboot and check again
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
User avatar
novitibo
Posts: 120
Joined: Mon Feb 29, 2016 5:11 pm

Re: npm and node_index.js high CPU load

Post by novitibo »

no, i did't paste everything
Jan 25 23:02:53 DietPi systemd[1]: Started Node-RED (DietPi).
Jan 25 23:03:05 DietPi node-red[1266]: 25 Jan 23:03:05 - [info]
Jan 25 23:03:05 DietPi node-red[1266]: Welcome to Node-RED
Jan 25 23:03:05 DietPi node-red[1266]: ===================
Jan 25 23:03:05 DietPi node-red[1266]: 25 Jan 23:03:05 - [info] Node-RED version: v1.2.7
Jan 25 23:03:05 DietPi node-red[1266]: 25 Jan 23:03:05 - [info] Node.js version: v15.6.0
Jan 25 23:03:05 DietPi node-red[1266]: 25 Jan 23:03:05 - [info] Linux 5.4.83-v7+ arm LE
Jan 25 23:03:10 DietPi node-red[1266]: 25 Jan 23:03:10 - [info] Loading palette nodes
Jan 25 23:03:24 DietPi node-red[1266]: 25 Jan 23:03:24 - [info] Settings file : /mnt/dietpi_userdata/node-red/settings.js
Jan 25 23:03:24 DietPi node-red[1266]: 25 Jan 23:03:24 - [info] Context store : 'default' [module=memory]
Jan 25 23:03:24 DietPi node-red[1266]: 25 Jan 23:03:24 - [info] User directory : /mnt/dietpi_userdata/node-red
Jan 25 23:03:24 DietPi node-red[1266]: 25 Jan 23:03:24 - [warn] Projects disabled : editorTheme.projects.enabled=false
Jan 25 23:03:24 DietPi node-red[1266]: 25 Jan 23:03:24 - [info] Flows file : /mnt/dietpi_userdata/node-red/flows_DietPi.json
Jan 25 23:03:24 DietPi node-red[1266]: 25 Jan 23:03:24 - [info] Server now running at http://127.0.0.1:1880/
Jan 25 23:03:24 DietPi node-red[1266]: 25 Jan 23:03:24 - [warn]
Jan 25 23:03:24 DietPi node-red[1266]: ---------------------------------------------------------------------
Jan 25 23:03:24 DietPi node-red[1266]: Your flow credentials file is encrypted using a system-generated key.
Jan 25 23:03:24 DietPi node-red[1266]: If the system-generated key is lost for any reason, your credentials
Jan 25 23:03:24 DietPi node-red[1266]: file will not be recoverable, you will have to delete it and re-enter
Jan 25 23:03:24 DietPi node-red[1266]: your credentials.
Jan 25 23:03:24 DietPi node-red[1266]: You should set your own key using the 'credentialSecret' option in
Jan 25 23:03:24 DietPi node-red[1266]: your settings file. Node-RED will then re-encrypt your credentials
Jan 25 23:03:24 DietPi node-red[1266]: file using your chosen key the next time you deploy a change.
Jan 25 23:03:24 DietPi node-red[1266]: ---------------------------------------------------------------------
Jan 25 23:03:24 DietPi node-red[1266]: 25 Jan 23:03:24 - [info] Starting flows


everythimg seems fine. node-red works perfectly.

should I ignore mentioned issue or do you think that it needs to be investigated further?


after stop node-red:

Jan 25 23:09:24 DietPi node-red[1266]: 25 Jan 23:09:24 - [info] Stopped flows
Jan 25 23:09:24 DietPi systemd[1]: node-red.service: Succeeded.
Jan 25 23:09:24 DietPi systemd[1]: Stopped Node-RED (DietPi).
User avatar
Joulinar
Posts: 5109
Joined: Sat Nov 16, 2019 12:49 am

Re: npm and node_index.js high CPU load

Post by Joulinar »

and starting it again?
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
User avatar
novitibo
Posts: 120
Joined: Mon Feb 29, 2016 5:11 pm

Re: npm and node_index.js high CPU load

Post by novitibo »

temporary fix:

with cron job that keeps those two processes alive just for needed 1 minute per day should be ok? :D
User avatar
Joulinar
Posts: 5109
Joined: Sat Nov 16, 2019 12:49 am

Re: npm and node_index.js high CPU load

Post by Joulinar »

novitibo wrote: Mon Jan 25, 2021 11:14 pm temporary fix:

with cron job that keeps those two processes alive just for needed 1 minute per day should be ok? :D
this I don't understood. What should be the aim?
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
User avatar
novitibo
Posts: 120
Joined: Mon Feb 29, 2016 5:11 pm

Re: npm and node_index.js high CPU load

Post by novitibo »

Joulinar wrote: Mon Jan 25, 2021 11:14 pm and starting it again?
no.

node-red does not keeps restarting
User avatar
Joulinar
Posts: 5109
Joined: Sat Nov 16, 2019 12:49 am

Re: npm and node_index.js high CPU load

Post by Joulinar »

so it is running fine now? No CPU spikes anymore?
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
User avatar
novitibo
Posts: 120
Joined: Mon Feb 29, 2016 5:11 pm

Re: npm and node_index.js high CPU load

Post by novitibo »

Joulinar wrote: Mon Jan 25, 2021 11:16 pm
novitibo wrote: Mon Jan 25, 2021 11:14 pm temporary fix:

with cron job that keeps those two processes alive just for needed 1 minute per day should be ok? :D
this I don't understood. What should be the aim?
I need node-red only for to few flows, all are scheduled for one second before and one second after midnight.
I can keep node-red alive only for those two seconds (or let's say 1 minute). For RPI's health ;)
User avatar
novitibo
Posts: 120
Joined: Mon Feb 29, 2016 5:11 pm

Re: npm and node_index.js high CPU load

Post by novitibo »

Joulinar wrote: Mon Jan 25, 2021 11:17 pm so it is running fine now? No CPU spikes anymore?
node-red isn't restarting, but node and npm processes are CPU spiking
Last edited by novitibo on Mon Jan 25, 2021 11:22 pm, edited 1 time in total.
User avatar
Joulinar
Posts: 5109
Joined: Sat Nov 16, 2019 12:49 am

Re: npm and node_index.js high CPU load

Post by Joulinar »

well you could create a script stating node, do a sleep 120 and stop node again. This than to be scheduled on cron
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply