ZMQ.poll cpu 100%
See original GitHub issue"Thread-2" Id=14 RUNNABLE
at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:86)
- locked sun.nio.ch.Util$2@7433a0f1
- locked java.util.Collections$UnmodifiableSet@698b69d0
- locked sun.nio.ch.EPollSelectorImpl@3fd00cd2
at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:98)
at zmq.ZMQ.poll(ZMQ.java:705)
at zmq.ZMQ.poll(ZMQ.java:618)
This is my code
PollItem[] items = new PollItem[ZmqConfig.ZMQ_POLLITEM_SIZE];
items[ZmqConfig.ZMQ_FRONTEND_POLLIN] = new PollItem(frontend.base(), zmq.ZMQ.ZMQ_POLLIN);
items[ZmqConfig.ZMQ_BACKEND_POLLIN] = new PollItem(backend.base(), zmq.ZMQ.ZMQ_POLLIN);
PollItem[] itemsout = new PollItem[ZmqConfig.ZMQ_POLLITEM_SIZE];
itemsout[ZmqConfig.ZMQ_FRONTEND_POLLOUT] = new PollItem(frontend.base(), zmq.ZMQ.ZMQ_POLLOUT);
itemsout[ZmqConfig.ZMQ_BACKEND_POLLOUT] = new PollItem(backend.base(), zmq.ZMQ.ZMQ_POLLOUT);
Selector selector = ctx.createSelector();
while (!Thread.currentThread().isInterrupted()) {
// Wait while there are either requests or replies to process.
zmq.ZMQ.poll(selector, items, ZmqConfig.ZMQ_MSG_POLLIN_TIMEOUT);
if (frontend != backend) {
zmq.ZMQ.poll(selector, itemsout, ZmqConfig.ZMQ_MSG_POLLOUT_TIMEOUT);
}
The result is that the application was blocked in the zmq.ZMQ.poll and the cpu is 100%.It is likely that the application was hang and could not accept any request.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Does ZeroMQ Poll function use excessive CPU on .NET?
I verified on my own system that passing 500 to poll will cause CPU utilization between 90 and 100%. Setting the value to...
Read more >100% CPU usage with zeromq Push socket with 0 listeners
I am currently in the process of implementing a communication pipeline between several processes using ZeroMQ, all using the Push/Pull mechanism ...
Read more >Re: [zeromq-dev] ZMQ I/O threads CPU usage
In practice this is a step function I would say. It's enough a 10-20 nsec difference to jump from 10-15% to 100% cpu...
Read more >Does ZeroMQ Poll function use excessive CPU on .NET?
I verified on my own system that passing 500 to poll will cause CPU utilization between 90 and 100%. Setting the value to...
Read more >zmq_ctx_set(3) - 0MQ Api
This setting is an easier way to get the same result. When ZMQ_BLOCKY is set to false, all new sockets are given a...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @lsk569937453 did you try with the lastest SNAPSHOT? Fixes where committed in that area after the 0.4.3 release.
I’m going to assume that the issue has been fixed, given what @fredoboulo said above and the fact that this issue was created 1-1/2 years ago.
Feel free to open if the issue persists in the latest release version.