Using VSCodium and a Local Repository and/or Codeberg. I want to create an integrated Workflow for UIBUILDER... (on Linux)

I think I have found a problem. I am sure that since doing the npm install from VSCodium Terminal, my Laptop Battery life is very reduced, the fan also runs flat out. If I first End Process for node-red and then npm, the fan soon shuts off.

I would assume that something in npm is starting at Boot. Is there any way to stop the npm Apps staring at Boot Time and only starting on request?

Not entirely sure of your workflow there? Doing any npm install? And how is the ending of node-red relevant? How are you running Node-RED? Is this Linux or Windows?

Check your running processes to see what is actually chewing up the CPU. It will generally be obvious.

Only if you have created something to do that. npm is passive, you run it manually. Packages installed using npm will only run if you've told them too.

Both Windows and Linux have methods to delay startup after boot I think. But I don't believe this is your issue.

System:
Ubuntu Linux 24.04, Dell Precision 7550

Workflow:
Full version of Node-RED running (RPi install script and run as a service with autostart), VSCodium with local storage only as Editor for UIBUILDER files.

npm install - Installed from the VSCodium Terminal as suggested in Post 13.

Since carrying our the npm install command the fan started to run. Checking the Processes and resources using System Monitor.

End Nose-RED process and the Node-RED process stops, fan goes off in seconds.

The heavier load starts on Boot. I can either Kill, End, or node-red-stop, heavier battery load stops as resources released.

I don’t understand why this was OK before doing the npm install and now we get a heavier Current Drain just by starting Node-RED.

Hope that is what you need.

Sorry about the long delay in completing the above. Had a few things arise while I was getting information and forgot these…

Ah, gotcha.

So the npm install you are running is in the uibuilder instanceRoot for your instance of the uibuilder node. It installs ESLINT and extensions to that folder so that the eslint config I supply will work correctly. Obviously, it will also install any other things you've added to your package.json devDependencies or dependencies properties.

None of these things should have any impact on Node-RED since they are devDependencies only, they only do anything when you manually run the eslint command or ... hang on, instead of stopping Node-RED, try closing VSCodium - could be that it isn't coping with the eslint config?

Also though, <7% CPU - there is no way that should be causing your fans to go on permanently. My live Node-RED runs on an old laptop and seems to vary wildly, sometimes 0%, popping up to 8 or 9% and occasionally boosting to around 35%. That server never turns on its fans. Resident memory is around 250MB.

Is there something else driving CPU use? What, for example, is pinning CPU4 at 100%?

VSCodium is not loaded at start, always started manually - which is why I do not understand what is happening. My thoughts were that npm install should run only within VSCodium.

If I uninstall VSCodium, I would presume that the npm modules would be removed as well? I had the laptop apart less than a year ago and cleaned all fans, cooling pipes and heat exchangers to endure best cooling.

Unfortunately, I can’t see what causes each CPU load, but 100% on a single Core within a Processor will cause heating. Of course, the running of the fans is subjective, this laptop hardly hardly runs fans at all.

I am now using Waterfox to view the Forum as Brave was using several/many processes, but seemingly still the same heat load produced.

If I run after using node-red-stop no CPU is continuously above 2% except the odd ā€˜burst’

Oh, I should add that I use the fans of an indication of load and from that Battery Life. I often use this computer without external power. In the past Node-RED has not ā€˜been a problem’ for battery load/life- now it is and I want to understand why.

I have added psensor to monitor the temperatures.

It runs in the terminal session that VSCodeium creates for you. On LINUX, that would be a BASH terminal session (or ZSH or whatever you are using). If you check your active apps (using HTOP for example, set to show the execution hierarchy), you will see that your manual terminal or SSH login session under your window manager creates the VSCodium app entry which then spawns its own BASH terminal session. Closing VSCodium will (usually) terminate the terminal and anything running in it as well. Though, on Windows at least, it is possible to very occasionally get something stuck in there even when VSCode goes away.

Not at all! The terminal session in VSC is just that, there is no link between what you've done in that session and VSC itself. npm acts on the filing system, that's it.

Install something like HTOP (run from the command line under SUDO) to get a much deeper view of what is doing what.

Example HTOP:


That is about 1/2 of what is running on my laptop server.

As do I. I am really struggling to see how this can relate to a VSC/NR/UIB interaction.

Have you tried doing deleting the node_modules folder in your instanceRoot? Firstly without restarting node-red. If that does fix it, I think you should manually install the dev dependencies one at a time, use npm install --save-dev packagename or -d to do that. That should find out what is causing the issue.

Hi Colin,

Reading this with interest.
You have a Dell Precision 7550, and I think I am correct in seeing it has 16GB of ram and a swap size of 4GB setup.

Are you saying if you stop node-red that you then notice general CPU usage is a lot lower than when node-red is running ?

When you stop node-red are you closing browser tabs associated with node-red or leaving then up ?
How many tabs do you have open ?
How many browsers and bowers instances do you have open, say multiple instance of Waterfox and other browsers ?

The reason I ask is because it is something I notice on my NUC, when the various browsers I have are loading up the CPUs due to all the tabs are being maintained. I might have 300 to 500 tabs in Firefox and 100 or so in Opera and 8 in Chrome. With 65GB of RAM the swap tends not to get used, but the CPUs in the NUC get a workout from time to time. I would only shutdown my system once every two months, generally after kernel update, only putting it to sleep at the end of the day, meaning memory used by the various applications I run, especially browsers may not get cleaned up.

Yes, as Julian suggests, running htop and under sudo can reveal a lot, while not consuming too much itself as it does not use the desktop environment GUI. It is one of my most used tools for headless systems when checking things, very helpful.

It's good to hear you open up the laptop from time to time to get in there and clean dust that does accumulate. I do it with all my systems a few times a year. It does make a difference and hopefully fans will last longer.

If you are noticing that the fans are operating more of the time when node-red is running, could it be something in your flows that might be caught in a race condition, is this possible in node-red, I do not know ?

You could try disabling parts of flows or whole flows, redeploy and let it run a bit to see if there is any change.

Will be interested to find out what you find and where the problem is.

1 Like

Colin,

The Dell laptop, is this the system you run node-red on ?
If yes, is this your normal setup or would you normally run node-red on a separate system, say single board computer like a RPi ?

Still, something is happening with node-red for it to grab 100% CPU usage as shown in your system monitor

A lot of questions from both of you, and all relevant! Many of them I have been asking myself.

I have a cunning plan! (Baldwick - Black Adder in case Paul hasn’t seen it)

I have loaded htop. When I have done these tests, all other programs/Apps are shutdown except Browser, (h)top and a Terminal. The Browser was Brave but there are loads of Tabs in there (~30) so I shut that down and used Waterfox. I will shutdown all other tabs during the tests. KISS applies to both Hardware and Software.

I have removed Node-RED as a service for now, I can soon start it when needed. Today I have a Rack of Ribs to cook in a BBQ Sauce which will take most of my attention (especially at the price they are today!), but I want to:
leave Laptop as is to keep the same Baseline
ALL tests to be done after a Clean Start
Snapshot of each condition (htop) and comparison with previous conditions

My one thought so far is that the Laptop may have been on the cusp of starting the fans and something has just driven it over the top when NR is running to start the fans. The thing that concerns me is that the fans started immediately I did the npm install from the VSC Terminal.

I am a long serving Equipment Engineer (I liked fixing things), this has left me with an ability to know when things are ā€˜different’ as they don’t fall into the pattern I have sub-consciously learnt, my Family hate me for it, I am always asking ā€˜What’s that noise’ and nobody else has detected a change and so considered a pain in the posterior when I mention something! (It may not only be my Family…) :laughing:

Yes Paul, the Laptop is as you described:
System Details Report


Hardware Information:

  • Hardware Model: Dell Inc. Precision 7550
  • Memory: 16.0 GiB
  • Processor: IntelĀ® Coreā„¢ i7-10875H Ɨ 16
  • Graphics: IntelĀ® UHD Graphics (CML GT2)
  • Disk Capacity: 1.8 TB

Software Information:

  • Firmware Version: 1.43.0
  • OS Name: Ubuntu 24.04.4 LTS
  • OS Build: (null)
  • OS Type: 64-bit
  • GNOME Version: 46
  • Windowing System: Wayland
  • Kernel Version: Linux 6.17.0-14-generic

4GB is registered by htop and htop shows very low, if any SWAP usage.

At the end of the day, it may be that NR has always been a high user of CPU and not quite driventhe fans, a software update here, a flow update there may have increased the ā€˜base load’, but I doubt that it should be using 100%

I will also go back to a basic NR and gradually load Nodes from the palette Manager and then gradually add the flows.

NR ā€˜proper’ runs on a RPi4 on the same Network. ALL Development is done on the Laptop, so I am connected to both installations of NR, but the remote connection will only affect the Browser, not NR itself here on the Laptop.

Well, quite a few words, and an even longer process, I will start in earnest tomorrow. (As in Monday!!)

Thank you both for your help and interest in what is, currently, my observation! Here’s hoping to get it fixed. Oh, here is htop for a restart, load Waterfox in Safe Mode (waterfox –safe) look at this Topic. Set as a Baseline. (Waterfox –safe does appear sometimes and then disappears but only uses ~3%)

1 Like

A cunning plan is a foot, well said Baldrick :slight_smile:
Let me read . . .

node-red-start produces this (but no node-red process yet under htop).

except:

image

The ā€˜node’ command/process in htop changes to ā€˜node-red’ after a node-red-stop…node-red-start.

That would be normal if the laptop were already on the edge of needing them. Not unusual for additional network activity (npm downloading the packages from the Internet) and it does have to unpack everything onto storage - LOTS of files. I don't think that the default install for a uibuilder instance needs any compile steps but of course, that would also load things up.

BUT, after a few minutes at the very most, everything should calm back down again. This should all be fairly clear if you monitor HTOP while doing the install. And obviously, you should get the exact same results if you run the npm install in a standard terminal instead of VSC's terminal.

Sooooo, here are the notes of what i have done so far…

Fresh restart of Computer
Open TWO Terminals
In one start htop
Wait 3 minutes for system to settle - prtsc
node-red-start —safe wait 2 minutes - prtsc - 99%CPU
node-red-stop wait - prtsc
node-red-start wait - prtsc - 99%
node-red-stop - prtsc

NO other programs are running other than those in the background monitored by htop

To me, as NR has been run in safe mode it should be in it's smallest 'profile' i.e without running flows. There are messages from Nodes, but I will now disable them one by one to see if a particular one is causing a problem. In fact, I am starting with clean NR Installation. (.node-red backed up!)

Install Node-RED No Projects, no encryption.

Shutdown - Restart
Open two Terminals
Start htop - wait 2 min - prtscr
node-red-start - prtscr - NR not near the top of usage.

Load ONLY Nodes that are being used in project for now. (UIBUILDER, node-red-contrib-sun-position, can't remember the rest!) - htop - NR not registering.

Reload old Flows and remove unwanted stuff first!

Followed Deeceejay script for clean install
sudo apt purge -y nodejs npm
sudo apt update
sudo apt upgrade

Reinstall Node-RED
Shutdown - Restart
CPU use shoots to 100%
Removed unused Nodes - STS
Remove all Flows not being used that are currently disabled - STS (Is temp rise exponential???) - STS
Remove all unused Nodes now Flows have gone (prtscr)
Running Node-RED with minimal flows for development and minimal Nodes - 100%

STS - Still the same.

Still got 100% CPU when NR is running. I have a minimal install for my development and the noise is getting on nerves!! My Wife’s especially.

My current question is - Have I installed all new npm_modules with the work I have done??

Other than that I can only assume that the rapid rise in temperature is due to an installed Node, there aren’t many left!!

I will now start taking down the remaining Nodes… I will also look for any loops I might have introduced into gathering data for UIBUILDER, the other bits in the flows have been used for years.

@TotallyInformation Does this need to be split and posted to a new Topic? We are getting very very far away from using VSC with UIBUILDER! That is of course if you have the ā€˜Power’

That doesn't work. The command node-red-start does not take --safe as a parameter. The log output when you typed that should have shown it starting the flows. You have to use (after stopping node-red) just
node-red --safe

2 Likes

Thanks @Colin I will make a note of that.

Good News, It seems one of my Flows is ā€˜Bad’ If I disable it CPU% usage goes down from 100% to <2.6% on a single core. Temperatures are looking good at ~55-65 deg C. More importantly - No Fan!

Looking back, iirc, and with hindsight of course, I was modifying this ā€˜Bad’ flow to run with UIBUILDER while I was gradually configuring VSCodium with recommended installs etc.. Yes, that old nugget - one thing at a time. It is after all what we tell people with less experience, along with taking Backups!

The experience has given me a better understanding of the interplay between npm and NR/UIBUILDER/VSCode(ium).

Thanks go to both @TotallyInformation and @vonbaron for their valuable input, it all helped immensly!

1 Like

Narrowed this down further to an incorrectly configured InfluxDB Node, it was looking for https://localhost. This is an old flow and I had previously learnt that it was better to use a full address when configuring these Nodes. I must have missed this one.

Problem solved of the massive CPU use.

1 Like