Argonne-National-Laboratory / node-red-contrib-os

Node-Red nodes for obtaining cpu system information.
Other
10 stars 11 forks source link

node-red-contrib-os | Different behavior on different device #15

Open Mani-i4point0 opened 1 year ago

Mani-i4point0 commented 1 year ago

hi @jayharper In my project I am using the below mentioned hardware. I am using memory form 'node-red-contrib-os'

Architecture: armv7l Byte Order: Little Endian CPU(s): 4 On-line CPU(s) list: 0-3 Thread(s) per core: 1 Core(s) per socket: 4 Socket(s): 1 Model: 4 Model name: ARMv7 Processor rev 4 (v7l) CPU max MHz: 1200.0000 CPU min MHz: 600.0000 BogoMIPS: 76.80 Flags: half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32

Even though the h/w and the code are same for all these three devices, the behavior's of the node memory are different, I am not sure which of these three device memory node result is good, Can you please advice me on the required steps to make it right ? Please do refer the attached node-red forum details.

Happy to share any info which can help in fixing this .

https://discourse.nodered.org/t/memory-usage-node-red-contrib-os-0-2-1/72549

FreeMemory_node

Best Regards, Mani

Ekristoffe commented 1 year ago

Hello, I saw the post on the node-red discourse. I see the problem is an non consistent return of free memory from node-js. On this node we only use node-js vanilla command:

  let tmem = os.totalmem();
  let fmem = os.freemem();
  const pmem = parseFloat((100 - (fmem / tmem) * 100).toFixed(2));

with the payload as:

  msg.payload = {
      totalmem: tmem, 
      freemem: fmem, 
      memusage: pmem
  };

Maybe this is more a node-js problem. What does the different node-js command does on those systems ?

Mani-i4point0 commented 1 year ago

Hello, Thanks for responding to my query, Not much Node-js command has been used. I am using this node to monitor the RAM utilization. Apart from this node, I have a nodes from 'node-red-contrib-process-resources 1.1.0' this node too have a info related to memory. do you think, this would be the reason for this issue ?

  1. How can i fix this ? Happy to share any further info on this.

You input highly appreciated.

Best Regards, Mani

Ekristoffe commented 1 year ago

Does the process resources also give you different result ?

Mani-i4point0 commented 1 year ago

Hi, Sorry for misleading you , there is no impact on using the node-red-contrib-process-resources 1.1.0

I tired with the node-red-contrib-linux-memory option. please refer the below image.

image

Can you please advice, whether freemem on the 'node-red-contrib-os' means the 'free' memory data shown from free -b command or it's 'available' memory data ?

Also, Please advice if there is any fix required on node-js for using the node-red-contrib-os ?

Ekristoffe commented 1 year ago

Hello, Unfortunately it seem node-js only return the available memory as free memory ... I don't know why they do this on linux. Also I had plan to change this node to use another system but because of work load i haven't found the time to do it.

Mani-i4point0 commented 1 year ago

hi, Yes it is, Now reconfigured my flows with the node-red-contrib-linux-memory nodes and it's working fine. Thank you so much on helping me out.