Request for Investigation: TPS decrease with Node-RED HTTP GET Endpoint Vs Direct HTTP GET Endpoint (Created with Express server)

Just to add to what the others have mentioned.

This behaviour is probably to be expected. You have given no details about the flow you are testing, but I fully expect Node-RED to be doing a lot more work than the simple express application.

e.g. given even a flow like the following: http-in -> function node -> http-out

  1. Node-RED receives the request
  2. Builds the msg object (this involves some deep cloning of the req, res objects) and passes it to the Function node
  3. creates a nodejs vm sandbox to run the function node
  4. Executes the function
  5. passes the message to the http-out node
  6. sends the response

The work around the function node is not a trivial step and would probably account for most of the difference.

This is of course also not including any other node/flows that may be running or things like debug nodes sending data any open editor sessions over the websocket connection.

Node-RED's main focus is to provide a visual flow based programming environment to allow none programmers to build solutions, it values simplicity and ease of use of raw over performance.

Now, that's not to say that performance improvements can not or should not be made, if you want to investigate this and suggest improvements they would be greatly appreciated.

If you would like others to help, then you have to make it as easy as possible, since as others have pointed out, this is a volunteer community mainly working in their spare time. Please provide full details of the flows you tested, the express app you are comparing to and details of how you are driving the load in your tests.

2 Likes