# NR running, but all flows disabled, should the CPU load for NR process(es) not be very low?

**URL:** https://discourse.nodered.org/t/nr-running-but-all-flows-disabled-should-the-cpu-load-for-nr-process-es-not-be-very-low/59046
**Category:** General
**Created:** [26 February 2022 23:17 UTC](https://discourse.nodered.org/t/nr-running-but-all-flows-disabled-should-the-cpu-load-for-nr-process-es-not-be-very-low/59046 "2022-02-26T23:17:36Z")
**Posts on this page:** 19
**Page:** 1

<div class="post-metadata">

### Author: ![Nodi.Rubrum](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nodi.rubrum/32/107482_2.png) [@Nodi.Rubrum](https://discourse.nodered.org/u/Nodi.Rubrum)
#### Post date: [26 February 2022 23:17 UTC](https://discourse.nodered.org/t/nr-running-but-all-flows-disabled-should-the-cpu-load-for-nr-process-es-not-be-very-low/59046/1 "2022-02-26T23:17:36Z")

</div>

NR running, but all flows disabled, should the CPU load for NR process(es) not be very low?

```auto
top - 23:16:15 up 45 min, 3 users, load average: 6.96, 5.02, 7.27
Tasks: 89 total, 5 running, 84 sleeping, 0 stopped, 0 zombie
%Cpu(s): 75.5 us, 22.3 sy, 0.0 ni, 0.0 id, 0.0 wa, 0.0 hi, 2.2 si, 0.0 st
MiB Mem : 224.0 total, 31.5 free, 112.6 used, 80.0 buff/cache
MiB Swap: 100.0 total, 71.8 free, 28.2 used. 67.8 avail Mem

  PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
 3056 pi 20 0 153820 40916 25784 R 22.2 17.8 0:24.97 npm
 3084 pi 20 0 153424 41264 26856 R 19.4 18.0 0:23.05 npm
 3079 pi 20 0 153552 41932 27708 R 18.5 18.3 0:22.90 npm
  250 root 20 0 12872 944 748 S 14.5 0.4 5:12.35 pigpiod
 2958 pi 20 0 184904 66400 28128 R 12.7 28.9 1:30.99 node-red
 2970 root 20 0 11208 2932 2532 S 2.8 1.3 0:07.90 top
 3498 root 20 0 11236 3128 2552 R 2.8 1.4 0:00.35 top
    9 root 20 0 0 0 0 S 1.5 0.0 0:40.60 ksoftirqd/0

```

Can someone provide some insight on why npm/node-red threads are so busy? When I exported the flows, deleted all, leaving a new empty flow. The CPU load dropped. Import of the flows file again, all flows disabled, the CPU load remained low. So, just disabling the flows, did not really stop processes? Yes, did a deployment after disable of flows, because the saved flow file was done after deployment.

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [26 February 2022 23:21 UTC](https://discourse.nodered.org/t/nr-running-but-all-flows-disabled-should-the-cpu-load-for-nr-process-es-not-be-very-low/59046/2 "2022-02-26T23:21:45Z")

</div>

How are you running Node-RED? I can't think why an 'idle' NR instance would have any npm processes running.

---

<div class="post-metadata">

### Author: ![Nodi.Rubrum](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nodi.rubrum/32/107482_2.png) [@Nodi.Rubrum](https://discourse.nodered.org/u/Nodi.Rubrum)
#### Post date: [26 February 2022 23:25 UTC](https://discourse.nodered.org/t/nr-running-but-all-flows-disabled-should-the-cpu-load-for-nr-process-es-not-be-very-low/59046/3 "2022-02-26T23:25:02Z")

</div>

Just the typical systemctl stop, restart, etc.

---

<div class="post-metadata">

### Author: ![Nodi.Rubrum](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nodi.rubrum/32/107482_2.png) [@Nodi.Rubrum](https://discourse.nodered.org/u/Nodi.Rubrum)
#### Post date: [26 February 2022 23:26 UTC](https://discourse.nodered.org/t/nr-running-but-all-flows-disabled-should-the-cpu-load-for-nr-process-es-not-be-very-low/59046/4 "2022-02-26T23:26:50Z")

</div>

At first I thought I had somehow not disable the flows right, but the flows file loaded again, all already disabled. Hum, odd. I will see if I can recreate. Not a big deal just seemed odd.

---

<div class="post-metadata">

### Author: ![Nodi.Rubrum](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nodi.rubrum/32/107482_2.png) [@Nodi.Rubrum](https://discourse.nodered.org/u/Nodi.Rubrum)
#### Post date: [26 February 2022 23:29 UTC](https://discourse.nodered.org/t/nr-running-but-all-flows-disabled-should-the-cpu-load-for-nr-process-es-not-be-very-low/59046/5 "2022-02-26T23:29:03Z")

</div>

PiGPIOd is using a lot of time as well, when it really has not work to do, so have to track that one down too.

---

<div class="post-metadata">

### Author: ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)
#### Post date: [27 February 2022 06:34 UTC](https://discourse.nodered.org/t/nr-running-but-all-flows-disabled-should-the-cpu-load-for-nr-process-es-not-be-very-low/59046/6 "2022-02-27T06:34:13Z")

</div>

pigpio daemon is a known resource hog - always has been

---

<div class="post-metadata">

### Author: ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)
#### Post date: [27 February 2022 06:52 UTC](https://discourse.nodered.org/t/nr-running-but-all-flows-disabled-should-the-cpu-load-for-nr-process-es-not-be-very-low/59046/7 "2022-02-27T06:52:05Z")

</div>

Hi @Nodi.Rubrum,  
Perhaps you could give my [node-red-contrib-v8-cpu-profiler](https://github.com/bartbutenaers/node-red-contrib-v8-cpu-profiler/blob/main/README.md) a try. Via the example flow you can start it, and after e.g. 30 seconds stop it. And then share the .profile file here (which you can find in the path specified in the FileOut node).  
Don't think I have thread it yet for sub-processes, so not sure if we can find the root cause with it.  
Bart

---

<div class="post-metadata">

### Author: ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)
#### Post date: [27 February 2022 06:57 UTC](https://discourse.nodered.org/t/nr-running-but-all-flows-disabled-should-the-cpu-load-for-nr-process-es-not-be-very-low/59046/8 "2022-02-27T06:57:47Z")

</div>

Can he run it if his flows are disabled?

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [27 February 2022 07:00 UTC](https://discourse.nodered.org/t/nr-running-but-all-flows-disabled-should-the-cpu-load-for-nr-process-es-not-be-very-low/59046/9 "2022-02-27T07:00:20Z")

</div>

I would start by working out why npm is running at all. Do you have anything in the system (not necessarily node red) designed to automatically check node versions or something similar?

---

<div class="post-metadata">

### Author: ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)
#### Post date: [27 February 2022 07:14 UTC](https://discourse.nodered.org/t/nr-running-but-all-flows-disabled-should-the-cpu-load-for-nr-process-es-not-be-very-low/59046/10 "2022-02-27T07:14:53Z")

</div>

Morning Simon,  
Well of course he will need to have one flow enabled, containing my example flow. Or he can start the profiler by adapting his nodejs startup command, and then connect e.g. with chrome developer tools to his nodejs instance (see [here](https://developer.ibm.com/tutorials/learn-nodejs-debugging-and-profiling-node-applications/#debugger-2-chrome-devtools)).

But I think injecting a simple start and stop message via my node isn't going to kill his performance, to be honest...

Anyway it is up to Nodi how he wants to analyze his problem further, since there are many ways to Rome ...  
Bart

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [27 February 2022 07:25 UTC](https://discourse.nodered.org/t/nr-running-but-all-flows-disabled-should-the-cpu-load-for-nr-process-es-not-be-very-low/59046/11 "2022-02-27T07:25:22Z")

</div>

> [@Nodi.Rubrum](#):
>
> `MiB Mem : 224.0 total`

Why have you only got 200MB RAM total? Even a Zero should have twice that.  
Part of the symptom you are seeing is that there is not enough RAM so it is swapping which will clog up the whole system. That does not explain why npm is running though.

---

<div class="post-metadata">

### Author: ![Nodi.Rubrum](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nodi.rubrum/32/107482_2.png) [@Nodi.Rubrum](https://discourse.nodered.org/u/Nodi.Rubrum)
#### Post date: [27 February 2022 08:35 UTC](https://discourse.nodered.org/t/nr-running-but-all-flows-disabled-should-the-cpu-load-for-nr-process-es-not-be-very-low/59046/12 "2022-02-27T08:35:12Z")

</div>

Yeah, the npm tasking is the real question, here IMHO. likely I have a flow triggering it, as I am writing this, I think the version checking, which is supposed to run at NR start up then stop, should spike the loading but back off. But what I saw today was longer than what the flow design would suggest. Moreover, the odd thing as I disabled flows I did not see the processes stop but continued until I restart NR, and the flows came up as disabled. My expectation was that if I disable a flow, and deploy the flow, I should see the applicable processes not exist or continue. It could be, the deploy was somehow incomplete, and flows I disabled did not really get disabled.

I just happen to discover this on a Pi Model 1B... which I use for testing flows under limited resources. The actual flows are pretty light, driving a few diodes via PiGPIOd, display a few system resource informational items, like current CPU, memory, IO stats. Use Pi 2B for testing, but serious flows only on 3B and now in a few cases 4B. I just re-imaged a new SD card, and will working through step by step to see what might be triggering the scenario. Already noticed PiGPIOd was doing something interesting while the Pi should pretty much be idle. Fired off a question to the PiGPIOd author about it as well.

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [27 February 2022 08:54 UTC](https://discourse.nodered.org/t/nr-running-but-all-flows-disabled-should-the-cpu-load-for-nr-process-es-not-be-very-low/59046/13 "2022-02-27T08:54:59Z")

</div>

I suspect what is happening is that the version checking is starting, but because you do not have enough memory it takes a very long time time (maybe tens of minutes). If you then disable the flow and redeploy it may not be killing the npm processes which are running. I suggest disabling that feature and rebooting and making sure npm does is not running.

I did not think even a 1B had only 256MB RAM, I am pretty sure it has 512, so something odd is going on there.

---

<div class="post-metadata">

### Author: ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)
#### Post date: [27 February 2022 09:36 UTC](https://discourse.nodered.org/t/nr-running-but-all-flows-disabled-should-the-cpu-load-for-nr-process-es-not-be-very-low/59046/14 "2022-02-27T09:36:57Z")

</div>

> [@Colin](#):
>
> I did not think even a 1B had only 256MB RAM

[https://forums.raspberrypi.com/viewtopic.php?p=281257](https://forums.raspberrypi.com/viewtopic.php?p=281257)

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [27 February 2022 10:01 UTC](https://discourse.nodered.org/t/nr-running-but-all-flows-disabled-should-the-cpu-load-for-nr-process-es-not-be-very-low/59046/15 "2022-02-27T10:01:22Z")

</div>

So 256MB was an option.  
I think I would advise against trying to run anything other than an absolute minimum node-red with that amount of memory. Certainly don't try to run npm at the same time as node-red.

---

<div class="post-metadata">

### Author: ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)
#### Post date: [27 February 2022 11:08 UTC](https://discourse.nodered.org/t/nr-running-but-all-flows-disabled-should-the-cpu-load-for-nr-process-es-not-be-very-low/59046/16 "2022-02-27T11:08:24Z")

</div>

I run my speak to Alexa flow on mine

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/b/6b4efde51f3453d89e66c886e25b810b67b88bdf.png)

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [27 February 2022 15:29 UTC](https://discourse.nodered.org/t/nr-running-but-all-flows-disabled-should-the-cpu-load-for-nr-process-es-not-be-very-low/59046/17 "2022-02-27T15:29:54Z")

</div>

I think you are getting a bit near the limit there, you have used most of your swap up!

---

<div class="post-metadata">

### Author: ![Nodi.Rubrum](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nodi.rubrum/32/107482_2.png) [@Nodi.Rubrum](https://discourse.nodered.org/u/Nodi.Rubrum)
#### Post date: [3 March 2022 14:25 UTC](https://discourse.nodered.org/t/nr-running-but-all-flows-disabled-should-the-cpu-load-for-nr-process-es-not-be-very-low/59046/18 "2022-03-03T14:25:45Z")

</div>

The very first Model B units had only 256MB memory. I just happen to have one of these rarer units. These were produced in February 2012. There were even some Model A units with only 256MB produced in 2013, but these did not have the same connectivity options as the early model B, so only purchased the B model at the time.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [17 March 2022 14:26 UTC](https://discourse.nodered.org/t/nr-running-but-all-flows-disabled-should-the-cpu-load-for-nr-process-es-not-be-very-low/59046/19 "2022-03-17T14:26:06Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
