[zeromq-dev] CPU load while polling 0mq sockets
Sergey Malov
smalov at mdialog.com
Fri Feb 3 20:53:24 CET 2012
Hi Chuck,
That's essentially what I'm doing - setting timeout to 20000000 microseconds, or 2 seconds, and CPU usage is still more than 100%.
Sergey
On 2012-02-03, at 2:40 PM, Chuck Remes wrote:
> On Feb 3, 2012, at 1:36 PM, Sergey Malov wrote:
>
>> Hi,
>> I have an application using three different 0mq socket types:
>> - PULL, to receive protocol buffer messages from outside for further processing,
>> - PUB, to publish results (in protocol buffer format as well)
>> - REPLY, to occasionally answer on status query, etc
>>
>> All sockets are being polled in single cycle. It's a Scala application, using scala zeromq binding, and 2.1.11 0mq library.
>> What I observe, being idle this app still utilizes more than 100-120% CPU on 4-cores linux box (using top utility). Under "idle" I mean that it is started and polling sockets, but notching is there to pull/publish.
>> I played with setting timeout (using setTimeout on poller), latest I've set was to 2000000 microseconds, with no obvious effect on CPU usage. I know that most of the time it spends polling, since I monitor it with profiler.
>>
>> Is it normal, such a high CPU utilization? Is there anything wrong with what I'm doing? Something I should check/set ?
>
> Try setting the timeout period to 1 second. If you still see high CPU then it's likely a bug in the Scala or Java binding. With a 1s timeout, cpu utilization should be 0.
>
> cr
>
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
More information about the zeromq-dev
mailing list