Node-red-node-mysql: mysql query blocks node-red

Dears all,
unfortunately I had this problem using mysql node.

I'm using node-red-node-mysql version 0.1.1
Please refer to previous information and tests in this topic:

After different test, it seems that mysql node use all node-red resources to execute my query, so other nodes (i.e. uibuilder) goes in starvation (and all web connection are closed by client).

Normally mysql node work without problem, but in this case I need to retrieve 2 tables with 40k rows each one in a unique query.
My query is very simple "SELECT * FROM table1; SELECT * FROM table2;".

This query took about 2 seconds using mysql query (mysql CLI) or DBeaver, but mysql node block resources for more than 40 seconds (node-red is 100% of CPU).

I added also some extra-info than msg.topic (i.e. msg.selection) used in next nodes (to by-pass mysql node) , but unfortunately I have the same problem also removing them.

Please, could you help me?

Thanks in advance

Not sure about the mysql node as I don't use it. However, this question/answer has some potentially useful information: javascript - How to asynchronously query a large amount of data with Node.js? - Stack Overflow

It may be that you will need to use a different node.js module and then consume it yourself in a function node (or write your own node!).

The problem stems from the single-threaded nature of node.js but there are certainly ways around it.

Please also see my answer on the other thread about a different way of doing things.

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