High amount of MongoDB traffic

Hello All,
We have an application where we have a remote edge device running Node-Red. Writing information to a MongoDB via the mongodb3in node. I don't know alot about databases and Mongo wasn't my choice, but the programming is working and we are successfully writing messages to the database.

The problem is that these machines are running on cellular. We have noticed significant data usage, much more than the messages we are sending. After a bunch of research and finally using wireshark, we realize the MongoDB3 node is constantly communicating with the database even when it is not receiving messages and using up a significant amount of data. If we disconnect the Mongo node and redeploy, the amount of traffic drops.

We would like it so that when the machine is not being used and no data is being written to the database, that our data usage is basically zero. So I expect this is not a node-red problem. And I am not sure where to start for help.

Does this sound like a misconfiguration of our node? (there isn't much configuration to it.)
Is it something just built into the node that we will not be able to avoid?

Is there some way to take the node offline until we need to use it?

I'd appeciate your input. Thanks!!

Firstly, have you made absolutely sure there are no messages going to the mongo node when there should not be?
Check the mongodb server node log (I presume mongodb can generate access logs) and see what it is doing.
Is mongoDB running on the remote device or the local? Is it the remote device that is on the cellular network?

image

Hi Colin,
Yes a simple flow like this or even just having the node in the program and not being used causes the high traffic flow.

The mongoDB node is running on a remote device on cellular, writing data to a cloud Mongo database. Does that answer your question?

I will check into the node log and see if i can post that. But I can't get it right this minute. Thanks for your help!!

Also look in the log for the cloud server.

I have asked the manager of the database to see if he can give a log for the cloud database.

But I am not quite sure where to find the log for the node itself. Can you give any help there?

The node itself doesn't have a log, but if you start node-red in a terminal then you will see the node-red log. I don't expect there to be anything useful, but always worth checking. Sometimes issues like this can be side effects of another problem.

Another approach might be to run node-red in the cloud (or on a server somewhere) as well as in your devices, and send information to it from your devices using something like MQTT, and send it to the database from that node-red server.

You might need to contact the author of that node.

Unlike InfluxDB, MongoDB's REST API is query only. If all you want to to is get data from the DB then you could use that directly from Node-RED using the http-request node. But to write data, you need a client.

At a push you could possibly use a command line client and call it via the exec node. Not very elegant though.

Thanks for your information.

I am thinking contacting them on github, but we are going over it to make sure there is nothing simple we are missing first.

We are only writing and not reading from the database.

It seems like the connection to the database never closes and it continues to poll whether or not we are writing messages.

Are you sure it is the mongo db node that is using the network bandwidth ? Maybe share the wireshark logs.

Here it is. Please let us know if we are interpreting this wrong. We see this even with the node disconnected. We have to delete the node to get it to stop.

Are you connecting to 3 different mongo db’s?

The screenshot only shows one communication to each mongodb node. How frequently is this happening?

Maybe you can also look into message that is send to mongo db to get some insight into what it is doing.

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