mikakaraila / node-red-contrib-opcua

A Node-RED node to communicate OPC UA. Uses node-opcua library.
Other
211 stars 196 forks source link

Perfomance when subscribing #584

Closed lmcemaj closed 1 year ago

lmcemaj commented 1 year ago

Hi

Thank you for your work on this.

I'm trying to subscribe to 1000 tags from a FactoryTalk Gateway where all data changes every second. I have set up my OPC UA client to an interval of 1 second. The flow works as it should and I receive the data.

When I measure performance (the number of messages per second), the number varies a lot. As you can see in the picture, it is everything between 8xxx and 11xxx. My machine is not terribly loaded, so it shouldn't be resources that are missing?

Any idea what could be causing this?

Link to flow: flow.txt

Untitled

mikakaraila commented 1 year ago

Subscription is not returning same amount of items as server will publish changed values with the subscription interval.

Check first server performance with UaExpert performance view: image

mikakaraila commented 1 year ago

Your flow contains unknown node msg.speed where I can get it?

image

I expect your are using this one: npm install node-red-contrib-msg-speed

mikakaraila commented 1 year ago

I made some testing and seems to be 999/sec

image

mikakaraila commented 1 year ago

I noticed after some time speed goes up/down. So I disabled Debug messages because they seem to cause variation. Without debug messages speed is constant 999/sec.

lmcemaj commented 1 year ago

Here is the performance test og the FactoryTalk Linx Gateway with 9999 tags. Screenshot 2023-08-10 132324

mikakaraila commented 1 year ago

Looks good, for the performance test don´t do anything else in your flow.

Remember this: https://stackoverflow.com/questions/11426185/will-console-log-reduce-javascript-execution-performance

mikakaraila commented 1 year ago

You can use my flow (attached above) just modify it to match you server address space.