My ongoing confusion after updating to Buster and CPU load

Yeah, ok, I know this isn't a RasPi forum.

But Node-Red is implicit.

RasPiZ(W). Anyway, getting to the problem:

This is what I see with htop

Those lines with --max_old_space_size.......

So looking about what this is/means.

Here...

The service comes configured for the pi user. To change which user it runs as, edit the service definition /lib/systemd/system/nodered.service

Path/file: /lib/systemd/system/nodered.service

Sorry, where?

(EDIT)

Sorry. Ok, I didn't go into the system directory.
I sometimes miss names in paths.

Yes, I know things change.

But it makes it confusing for idiots like me when we try to research what is going on.

Someone - please.
Looking for how to work out what those lines mean.
(As there are a lot of them)
And if that number doesn't match what the O/S is using there is a conflict.

Indeed not sure what this has to do with service files. Did you try googling "how to use htop" ?

Kind of.

I'm simply confused. None of this makes sense to me.

Just I saw about 10 instances of that on the screen shot.
It got me interested and I went off and read the link I supplied.

Alas it lacks . . . . context (?) for me. But that doesn't mean it isn't a problem. Though it also doesn't mean it is. I get that.

I am only asking for a bit of help to what that file does and how it would affect the machine and memory use.
But I can't understand it as written and hope someone smarter than me could (maybe) translate it to something I can understand, or at least get a better appreciation of it's place in the scheme of things.

Node-RED uses the Linux systemd to set up autostarting on boot - This is part of many Linux systems - again google is your fried to read up on systemd - eg Use systemd to Start a Linux Service at Boot | Linode - As part of that you can configure how it starts up and the service file defines some things that Node-RED needs like the user and working directory - and it also limits the amount of memory it tries to use. By default we set that to half of the available memory on the device so depending on which model Pi that number may vary. If you have absolutely nothing else of consequence running on the Pi you can up that to let Nod-RED have more - or if very busy with other things like databases etc then maybe less...

If you read up on Htop you will find that it will show every thread for a process..... and while node.js is essentially single threaded, it does spawn off other threads to handle things like async IO (writing to disk etc) - so it may well look like Node-RED is running multiple times... I think you can use the H key to stop it doing that - but RTFM...

Yes, ok. "RTFM" but it doesn't do me any good if it is written in a language which I don't speak/understand.

Basically since accidentally updating node-red (or some part of it) and it breaking and so I had to update to Buster, the machine which used to work is now basically non-usable.

Yeah, my problem. I am trying to work out what has gone on, but am being told (basically) "Too bad".

I am not running multiple versions of Node-Red.
But one thing I did notice is that the original flow file was 1.2 meg in size.
After making a new SD card and all that stuff and importing the flow it has grown to 2.4 meg.
(Basically doubled.)

It complained about the security key thing not being set by me, but the system default (what ever)

I have tried a few times to get my head around doing that to no avail. All I see is words.
Their greater meaning is lost on me.

So the fact that the flow size has doubled may also be contributing to the machine being nearly useless.

Rename the new flow file so it won't be used, and replace it with the smaller one from your backup. Then restart node red.

I don't think anyone is saying "too bad". Which language would you like/prefer ? We can only try to point you to manuals on htop and systemd if that is what you are asking about and there must be one out there that can help.

Not sure what/where you mentioned the security key - but the warning when you start up tells you which file to edit (settings.js) and what to edit (the credentialSecret property) - but it is just a warning and you don't have to set it - If you do you can then use those same credentials on another machine which makes moving flows easier - but if you don't you will need to re-enter them on a new machine.

I can't comment on why your flow file may have doubled in size unless for some reason you have imported it twice and there are two sets of flows running - but that should be obvious from the tabs at the top as they would be doubles as well. (unless hidden for some reason).

There needs to be a bit more than that done. I know this from a long time ago.
On THIS machine I did just that and the backup was deleted.

So the important bit is not only to rename the file but to put it else where.

But thanks.

That is also what I did.

When all this happened and I reflashed the SD card.

Installed NR, checked it was working.

Stopped it, copied the backup files to the directory.

Started NR got a few screens worth of complaints re: the signature being the default, and that they didn't match. Don't know why/how that happened.

NR started and when I looked the file size had doubled.

Ok. I thought I had done that. (Moving on)
I copy the flows.json and flows_cred.json file from their backup.

The flows.json has gone from 1.3 meg to 2.2 meg in size.

From New version of NR, lost in `settings.js` file - #3 by Trying_to_learn

That's a tricky point.
Same machine.
Said machine died and I rebuilt it.
So it is going back onto the same machine, but a different build of NR (and O/S)

I tried doing what I understand is needed to be done, but it doesn't/didn't work.
(That was a long time ago)

Well, I hope not. I stopped NR, put the new files in and started NR.
Lots of scrolling as it started which was kind of normal but some of them were new.
I didn't screen shot it.
There couldn't be any hidden tabs as the NR version was too early.

Why don't you delete the node-RED user directory, and re-import your backup again, taking more note of logs, warnings ect?

shall do shortly.

It might be informative to count the characters in your backup, flows.json after import and flows.json after a deploy.

The wc command wc flows.json reports the number of lines, words and characters in a file

ls -l flows.json
-rw-r--r-- 1 pi pi 288885 Dec  9 06:13 flows.json
wc flows.json
 11617  23635 288885 flows.json

1 Like

A good point from @jbudd, if you now have pretty print enabled, and didn't have before, then I think the file may get a lot bigger when you first deploy it.

1 Like

Well, after a lot of messing around, the flow.json is back to the 1.3 meg size.

For now I shall leave well enough alone. Between then and now there were a few changes to the flow/s and I have to do some catch up.

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