# Can someone help me with this "problem"

**URL:** <https://discourse.nodered.org/t/can-someone-help-me-with-this-problem/19455>\
**Category:** General\
**Created:** [22 December 2019 08:14 UTC](https://discourse.nodered.org/t/can-someone-help-me-with-this-problem/19455 "2019-12-22T08:14:53Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [22 December 2019 08:14 UTC](https://discourse.nodered.org/t/can-someone-help-me-with-this-problem/19455/1 "2019-12-22T08:14:53Z")

</div>

(Yeah, ask in the RPI forum. Most times I post there I get sarcastic - if not insulting - replies.)

I am not getting what is happening.

And while writing this thread/article the machine has hung.

This is what I see with the `top` command.

 ![Screenshot from 2019-12-22 19-10-48](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/f/fb78170b98e89bc4d7e781a45a2cd0d59143599b.png)

Yet when I ask NR, it says CPU load at 100% and just basically not moving.

It used to be pulsing from about 30% to 100% every 20 seconds on a time span to do things.  
I get that. When it has a few things to do the load goes to 100%.

But now just stuck at 100% all the time?

Yet `top` isn't really showing that.  
And as I just said, the machine has just hung when I got that screen shot.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [22 December 2019 08:26 UTC](https://discourse.nodered.org/t/can-someone-help-me-with-this-problem/19455/3 "2019-12-22T08:26:52Z")

</div>

I am hoping someone here may spot a problem or be able to help me understand what is going on.

I hope it isn't too much to hope.  
(as you can see from what I am typing I am stressed by the problem.)

---

<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:** [22 December 2019 08:33 UTC](https://discourse.nodered.org/t/can-someone-help-me-with-this-problem/19455/4 "2019-12-22T08:33:56Z")

</div>

I'm wondering if it might be a combination of circumstances

You might be running out of RAM memory and the Pi is swapping out to your SD Card

And that might be full

Are you able to run Node-RED without running apache and see what happens then?

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [22 December 2019 08:37 UTC](https://discourse.nodered.org/t/can-someone-help-me-with-this-problem/19455/5 "2019-12-22T08:37:13Z")

</div>

How do I not run `apache`?

Or stop it?

---

<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:** [22 December 2019 08:47 UTC](https://discourse.nodered.org/t/can-someone-help-me-with-this-problem/19455/6 "2019-12-22T08:47:10Z")

</div>

to stop it - type

sudo pkill -f apache2

in a terminal

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [22 December 2019 08:56 UTC](https://discourse.nodered.org/t/can-someone-help-me-with-this-problem/19455/7 "2019-12-22T08:56:16Z")

</div>

> [@Trying\_to\_learn](#):
>
> When it has a few things to do the load goes to 100%.

What are "a few things" ? This is where the problems originate.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [22 December 2019 08:57 UTC](https://discourse.nodered.org/t/can-someone-help-me-with-this-problem/19455/8 "2019-12-22T08:57:27Z")

</div>

Basically ping about 16 IP addresses on my local LAN.

That loads the machine. Otherwise it is ok.

---

<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:** [22 December 2019 09:17 UTC](https://discourse.nodered.org/t/can-someone-help-me-with-this-problem/19455/9 "2019-12-22T09:17:07Z")

</div>

This suggests something in your flows is stuck in a loop.

You can check that theory by:

1. Stop the Node-RED service : `node-red-stop`
2. Use `top` to verify NR has stopped and CPU usage is back at a normal level.
3. Start NR in safe mode : `node-red --safe`
4. Check top again.

If the cpu usage is still at the expected level, then the issue is with your flows.

Look for anywhere that might be looping in some form and add a debug node that also logs to the console (so it will appear in the output of node-red-logs).

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [22 December 2019 09:25 UTC](https://discourse.nodered.org/t/can-someone-help-me-with-this-problem/19455/10 "2019-12-22T09:25:33Z")

</div>

Just tested it, 40 addresses, 2% cpu (and possibly purely coincidental)

It will depend on _how_ you ping. Count 1 should be enough (`-c1`) - if answer then ok.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [22 December 2019 09:50 UTC](https://discourse.nodered.org/t/can-someone-help-me-with-this-problem/19455/11 "2019-12-22T09:50:28Z")

</div>

Ok, the events:

NR stopped:

```auto
pi@TimePi:~/.node-red $ node-red-stop

Stop Node-RED
 
Use node-red-start to start Node-RED again
 
pi@TimePi:~/.node-red $ 

```

NR stopped.

 ![Screenshot from 2019-12-22 20-41-15](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/0/064367755c830c675c525a4a915860974b275b2c.png)

Checking with `top` again after a while.

This popped up as an error which may need investigating:

```auto
����dExif

```

(Drats, can't copy from debug output.)  
See screen shot.

 ![Screenshot from 2019-12-22 20-44-26](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/a/a76e2026a998be841e8ac77f3d385f37cf1a1594.png)

 ![Screenshot from 2019-12-22 20-46-58](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/9/90ef89af6dcb2976354a3f336708291a5ac02f4a.png) ![Screenshot from 2019-12-22 20-47-10](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/4/40f437f71399b86caa65be3fdba8ec16b0696422.png)

I only modified small parts of flows after the update to NR 1.0.3 and latest dashboard.  
But nothing which should really make a difference.

Thought:  
If I have an OLD flow, can I back up this one and use an older one which didn't have the problem and see what happens?

---

<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:** [22 December 2019 10:05 UTC](https://discourse.nodered.org/t/can-someone-help-me-with-this-problem/19455/12 "2019-12-22T10:05:15Z")

</div>

> [@Trying\_to\_learn](#):
>
> If I have an OLD flow, can I back up this one and use an older one which didn't have the problem and see what happens?

Yes, that would be something you could try. Otherwise, as I said, think about where in your flows you might be looping and add some debug to try to narrow it down.

It may be your flows have been affected by the async message delivery changes that were in 1.0.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [22 December 2019 10:11 UTC](https://discourse.nodered.org/t/can-someone-help-me-with-this-problem/19455/13 "2019-12-22T10:11:40Z")

</div>

I rolled it back 1 month.

Same ☹  
100% CPU load (from another NR machine.)

It is obvious the machine is running 100% because even trying to `ssh` to it is painful.  
I can nearly go and make a cup of coffee in the time it takes to establish a connection.

That error message on the screen shot.... Is that something I should consider as a possible cause?

The only reason I am asking is once before a node was being problematic.  
If I had it installed, it would _kill_ the machine.  
Uninstalling it, it would work ok.  
Alas simply not using it didn't help.

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [22 December 2019 10:13 UTC](https://discourse.nodered.org/t/can-someone-help-me-with-this-problem/19455/14 "2019-12-22T10:13:02Z")

</div>

Error is coming from some camera or something in that direction. And which node is producing that output ? (click on the "node: Flow error message")

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [22 December 2019 10:16 UTC](https://discourse.nodered.org/t/can-someone-help-me-with-this-problem/19455/15 "2019-12-22T10:16:58Z")

</div>

(Blush) that error message is way gone.

I am hoping it has been logged to a file, but I am suspicious I am not logging errors.

The camera is on `CameraPi` (another machine)

I was messing around with FTP sending pictures from it to another machine.

ARGH!

Ok, I get it.

I had the alarms on `CameraPi` set to REMOTE, so when a node throws a wobbly, it sends the error to this machine.

Thanks. At least I don't need to worry about that.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [22 December 2019 10:23 UTC](https://discourse.nodered.org/t/can-someone-help-me-with-this-problem/19455/16 "2019-12-22T10:23:15Z")

</div>

On the idea of "running out of space":

```auto
pi@TimePi:/ $ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/root 15G 4.6G 9.4G 33% /
devtmpfs 213M 0 213M 0% /dev
tmpfs 217M 0 217M 0% /dev/shm
tmpfs 217M 17M 200M 8% /run
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 217M 0 217M 0% /sys/fs/cgroup
/dev/mmcblk0p1 42M 23M 19M 55% /boot
tmpfs 44M 0 44M 0% /run/user/1000
pi@TimePi:/ $ 

```

I'm not pushing my luck with this usage am I?  
33% and 55% usage.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [22 December 2019 10:36 UTC](https://discourse.nodered.org/t/can-someone-help-me-with-this-problem/19455/17 "2019-12-22T10:36:18Z")

</div>

Your original post showed

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/c/c0f2962e34c5239f569cebd241c17ba830e17137.png)  
a quick google for kswapd0 will tell you that it is the process that manages swapping things in and out of memory... and once that get busy you know you are running out of RAM. There are quite a few guides on things you can do to tune that a bit.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [22 December 2019 10:38 UTC](https://discourse.nodered.org/t/can-someone-help-me-with-this-problem/19455/18 "2019-12-22T10:38:59Z")

</div>

Thanks @dceejay

Not wanting to sound more stupid than I am (though I don't think that is going to be . . . . )  
That kind of stuff still is in the realm of _magic_ and I am not confident to go into it blindly.

Is it too much asking for help on it here?

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [22 December 2019 10:46 UTC](https://discourse.nodered.org/t/can-someone-help-me-with-this-problem/19455/19 "2019-12-22T10:46:22Z")

</div>

At the risk of being obvious... try typing " what is kswapd0 " into google.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [22 December 2019 10:48 UTC](https://discourse.nodered.org/t/can-someone-help-me-with-this-problem/19455/20 "2019-12-22T10:48:45Z")

</div>

Ok, I will try.

Going down said path, I found this link which I have visited and applied:

[Disable swap files](https://raspberrypi.stackexchange.com/questions/84390/how-to-permanently-disable-swap-on-raspbian-stretch-lite)

As I read it, it is **not** a good idea to have swap files active as they kill SD cards.  
Though this link may not say that, I remember it because one day I was exploring the net and read something about _swap files killing SD cards_, and therefore how to disable them.

This was done WEEKS ago. I can't really associate this as a cause.  
I have disabled it on ALL my RPIs and none of them (including the Zeros) seem to have any problems like this.

Also this is a RPI 2 quad(?) core. All the zeros are single.

---

<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:** [22 December 2019 11:41 UTC](https://discourse.nodered.org/t/can-someone-help-me-with-this-problem/19455/21 "2019-12-22T11:41:49Z")

</div>

It is not complicated. Something in your flow is clobbering the processor. Start it in safe mode and disable the code that triggers what you think is causing the problem (the pings or whatever). Deploy and check it is ok. Gradually re-enable bits until it goes wrong, then you will know the problem. It will not be the pings themselves it will be something that follows on from the ping.

[Next page](https://discourse.nodered.org/t/can-someone-help-me-with-this-problem/19455.md?page=2)
