-
-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
socket.pause() does not work at message level - is this by design? #139
Comments
Furthermore, |
I have a very similar problem caused by the BatchList implementation: #152 |
It would really help to get a response on design of this logic from the project owners... offhand I can't imagine why should a language binding do additional buffering outside of zmq itself, but it must have been done for a reason. I am wondering just how much production use with node.js has there been... certainly don't get a feel that node is a first-class citizen on zeromq.org. Which is really too bad given how well the paradigms fit together. |
I came across another problem with the BatchList queue: |
That sounds odd - if I understand it correctly, BatchList only pushes the messages to the zmq queue. The I/O reactor loop that talks to the socket is inside zmq and in a separate thread, so that should not be a bottleneck given additional CPU cores. If node.js thread is stuck just copying messages from BatchList to the queue, how can you possibly fix that? And doesn't it take more time to simply create that many messages? How big of a burst we are talking here? I haven't really read through C++ part of the node.js binding, so I may well be missing the key issue... |
I talk about 4000 messages per second on a quad-core armhf device. The issue may be on another place, but it looks like something blocks the node.js thread. |
Should be relatively easy to tell:
rather crude and plenty of overhead, but it should definitely tell you how bad the situation truly is (worst case: you get no console messages at all). If your queue is indeed stuck but creating/sending 4K messages doesn't take most of the second then yes, something else is going on... |
Thanks for the hint, I'll try it when I have time. |
The original authors for those sections are not around anymore. The primary reason I got involved was to fix builds on all the platforms and create the prebuilts for use across Electron and node. There are a variety of friction points in the current API and implementation that I'd love to see fixed up, even if it means a major release. @ronkorving was trying to do an overall refactor in JustinTulloss/zeromq.node#516 while @minrk was also hoping to fix some of the API up here. |
The latest 6.0 beta release has a new API that addresses some fundamental issues with the previous API (including the one described here). See #189 for more reasoning behind the new API. If you run into any problems feel free to report it here or in a new issue. |
As a 0mq learning exercise, I started implementing missing node.js examples in the guide. Ran into trouble here - http://zguide.zeromq.org/page:all#Prototyping-the-Local-and-Cloud-Flows: the queueing logic relies on ability to selectively poll sockets. The
pause()
/resume()
pair looked like it would do the trick so I tried it and discovered that the implementation uses a JS-only mode flag that is checked after the binding signals readiness but before dispatching the entire batch of messages. However it is not checked inside the loop iterating over the batch:will not actually pause until the entire batch of available messages is dispatched blithely running
cutoff
into negative!Questions:
socket.pause()
to the level of an individual message?The text was updated successfully, but these errors were encountered: