JustinTulloss / zeromq.node

Node.js bindings to the zeromq library
MIT License
1.65k stars 286 forks source link

How does Monitor Interval effect REQ/REP PUB/SUB network traffic? #601

Closed ehallander9591 closed 6 years ago

ehallander9591 commented 6 years ago

So, I have a process that manages a bunch of workers that uses a REQ/REP and a PUB/SUB pattern for each worker bee. I set the monitor interval to 250 ms and all has been working fine.

When I deploy onto a windows server, and startup the resource monitor, the amount of network traffic (bytes written) by this node process is upwards of 64-100 MB/s and that doesn't include any real application transactions, because the traffic is there whether I start the children or not, and it doesn't abate when the children do come online.

Suspecting the interval setting I played with increasing the value, and do notice that higher interval values (less often) does lead to a decrease in the traffic, but the cost of that is it takes that long to detect connect/disconnect events.

Now I haven't tried to narrow it down yet to whether it is actually the REQ/REP pattern or the PUB/SUB pattern that is the issue, but I am curious what part of the documentation I overlooked that would explain this behavior.

This is a windows run time environment. Development is Windows 10, deployment is a 2012 Server R2, but the answer may be independent of this.

ehallander9591 commented 6 years ago

Resolved. I stopped using monitor, and simply treat my resources as always connected, once I specifically connect.