[zeromq-dev] How does Zeromq Scale ?
Martin Sustrik
sustrik at 250bpm.com
Wed Nov 9 09:40:44 CET 2011
Hi Rahul,
> Is there any way kernel affinity concepts are used where in the process
> running are manually assigned to particular core ? if yes , then how are
> they been implemented ? or the scheduling of process is left to default
> kernel scheduler ?
When opening a 0mq context, you can specify the number of worker threads
to use. The idea is that there should be one worker thread per CPU core.
However, actual finding out of number of cores and assigning one worker
thread per core is not implemented yet -- feel free to try :)
Affinity can be set for each 0mq socket, meaning which worker threads it
is allowed to use (default: all). Thus, for example, TCP connections
handled by the socket are load balanced between all the corresponding
worker threads/CPU cores.
As for a single worker thread, when it handles multiple objects (such as
TCP connections), there's cooperative multitasking going on: each object
does a quantum of work and yields the CPU.
Martin
More information about the zeromq-dev
mailing list