[zeromq-dev] Need 100K+ IPC sockets

Laurent Alebarde l.alebarde at free.fr
Tue Feb 25 21:32:40 CET 2014

Le 25/02/2014 21:08, Joe Lin a écrit :
> I'm building a server that should support 100K+ concurrent users. A 
> user belongs to one or more groups and the number of groups would be 
> around 1/10 of the total users. Therefore there will be about 10K 
> groups. A user needs to be notified by the events that occur in the 
> groups that he/she belong and the events occur at a  frequency 
> 10/sec/group.
> My idea is to create a 0MQ broker per group. A user will be connected 
> to one or more brokers via 0MQ IPC socket (maybe a ROUTER socket). 
> When an event is sent to a broker the broker then route the event to 
> the connected clients. Let's say that a user usually belong to 5 
> groups. It means that, for 100K users and 10K groups I will need to 
> bind 10K IPC sockets and will need 500K IPC socket connection in the 
> server.
> So I have two questions regarding this:
> 1. Does this sound like a reasonable use case to use 0MQ IPC socket? 
> Any alternative design?
Consider PUB/SUB with the subscribe feature.
> 2. Does ZeroMq limit the number of sockets per context? It seems that 
> I get a failure of "too many open files" although my system has ulimit 
> of "unlmited"
Change the context limit woth:
         rc = zmq_ctx_set (ctx, ZMQ_MAX_SOCKETS, 1000000);
         assert (rc == 0);

> Thanks for any help.
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20140225/87b762df/attachment.htm>

More information about the zeromq-dev mailing list