Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion What's the most efficient method to broadcast a message to multiple (100Ks) of processes?

Received: by 10.204.83.12 with SMTP id d12mr80169bkl.16.1305262148874;
        Thu, 12 May 2011 21:49:08 -0700 (PDT)
X-BeenThere: erlang-programming@googlegroups.com
Received: by 10.204.40.73 with SMTP id j9ls1686877bke.2.gmail; Thu, 12 May
 2011 21:49:08 -0700 (PDT)
Received: by 10.204.240.142 with SMTP id la14mr84103bkb.6.1305262148589;
        Thu, 12 May 2011 21:49:08 -0700 (PDT)
Received: by 10.204.240.142 with SMTP id la14mr84102bkb.6.1305262148578;
        Thu, 12 May 2011 21:49:08 -0700 (PDT)
Return-Path: <erlang-questions-boun...@erlang.org>
Received: from hades.cslab.ericsson.net (hades.cslab.ericsson.net [192.121.151.104])
        by gmr-mx.google.com with ESMTP id e15si317774bke.5.2011.05.12.21.49.08;
        Thu, 12 May 2011 21:49:08 -0700 (PDT)
Received-SPF: pass (google.com: domain of erlang-questions-boun...@erlang.org designates 192.121.151.104 as permitted sender) client-ip=192.121.151.104;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of erlang-questions-boun...@erlang.org designates 192.121.151.104 as permitted sender) smtp.mail=erlang-questions-boun...@erlang.org; dkim=neutral (body hash did not verify) header...@gmail.com
Received: from hades.cslab.ericsson.net (hades [192.121.151.104])
	by hades.cslab.ericsson.net (Postfix) with ESMTP id 91BFB5C014;
	Fri, 13 May 2011 06:49:03 +0200 (CEST)
X-Original-To: erlang-questi...@erlang.org
Delivered-To: erlang-questi...@erlang.org
Received: from mail-iy0-f181.google.com (mail-iy0-f181.google.com
 [209.85.210.181])
 by hades.cslab.ericsson.net (Postfix) with ESMTP id E86DB5C035
 for <erlang-questi...@erlang.org>; Fri, 13 May 2011 06:49:00 +0200 (CEST)
Received: by iyb26 with SMTP id 26so2403063iyb.40
 for <erlang-questi...@erlang.org>; Thu, 12 May 2011 21:49:00 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
 h=domainkey-signature:subject:mime-version:content-type:from
 :in-reply-to:date:cc:content-transfer-encoding:message-id:references
 :to:x-mailer; bh=uK0KmQSzqLVw4bHf1eIwbcvmIjO1E3P3U6PoyKn2Qnw=;
 b=HiZ4Fdd12E0DZn4NXfqXwrMPV/JF0JGXkNoNvZosOyg7ka66VPs8ZmmbC2vqlkJhIH
 FoNqoHpIIRmQTujsLDHHfBKcq6SjsTpGTDX58Vvlw9AaMnqc+fdtKjRLfE1a+FpxYnwd
 OuYBeK6tDd62obAPylU6nWTvATaLYbtHyu/9o=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
 h=subject:mime-version:content-type:from:in-reply-to:date:cc
 :content-transfer-encoding:message-id:references:to:x-mailer;
 b=XlQ2cvUOnXvrCgoGXHKbh2Hn9nzNNKSuAlsafjwd6JM+TV9PMDA03ZDdEv8DE68d7M
 7azLGwr6ptCLmoZtwxdCPXpBOrC8VJLRbvmgXk2giPsLGCA8XLq+F+mtHXqZNrSeEFFm
 hO75nmwiEjEjWm3aNA+vIuHGc7qvuWJlDeheE=
Received: by 10.42.240.1 with SMTP id ky1mr1295271icb.156.1305262140278;
 Thu, 12 May 2011 21:49:00 -0700 (PDT)
Received: from [192.168.2.6] ([64.53.242.50])
 by mx.google.com with ESMTPS id 19sm801586ibx.52.2011.05.12.21.48.58
 (version=TLSv1/SSLv3 cipher=OTHER);
 Thu, 12 May 2011 21:48:59 -0700 (PDT)
Mime-Version: 1.0 (Apple Message framework v1084)
From: "Eric Newhuis (personal)" <enewh...@gmail.com>
In-Reply-To: <1a8c7fff-d999-49ba-b34b-cfa9c1868...@c10g2000yqh.googlegroups.com>
Date: Thu, 12 May 2011 23:48:53 -0500
Message-Id: <A6072400-0480-470E-8C38-0392E2EEE...@gmail.com>
References: <1a8c7fff-d999-49ba-b34b-cfa9c1868...@c10g2000yqh.googlegroups.com>
To: Zvi <zvi.avra...@gmail.com>
X-Mailer: Apple Mail (2.1084)
Cc: erlang-questi...@erlang.org
Subject: Re: [erlang-questions] What's the most efficient method to
	broadcast a message to multiple (100Ks) of processes?
X-BeenThere: erlang-questi...@erlang.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: <erlang-questions.erlang.org>
List-Unsubscribe: <http://erlang.org/mailman/options/erlang-questions>,
 <mailto:erlang-questions-requ...@erlang.org?subject=unsubscribe>
List-Archive: <http://erlang.org/pipermail/erlang-questions>
List-Post: <mailto:erlang-questi...@erlang.org>
List-Help: <mailto:erlang-questions-requ...@erlang.org?subject=help>
List-Subscribe: <http://erlang.org/mailman/listinfo/erlang-questions>,
 <mailto:erlang-questions-requ...@erlang.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: erlang-questions-boun...@erlang.org
Sender: erlang-questions-boun...@erlang.org

Um, are your processes in the same Erlang node (OS process) or are they distributed?  Are they distributed on the same network segment or over the internet?  What kinf of ping times do you get from the worst-case host?

If distributed then the only correct answer is to use hardware multicast and write your own binary packet readers.  ;-)  Or maybe there is already some library for that.  Hm.  I recall gen_tcp or something perhaps setup as an IP multicast reader/writer.  Memory doesn't serve me well from a life I led over 15 years ago.

Seriously if you really do have 100,000 clients then you may need to say something about message size, frequency, bursting, etc., before this could be better answered.  Also I worry about Erlang's networking kernel sending heartbeats over the net.  Is this all local or are we talking internets?

On Oct 7, 2010, at 7:01 AM, Zvi wrote:

> Hi,
> 
> what's the most efficient method to broadcast a message to multiple
> (100Ks) of processes?
> 
> The most naive way is:
> 
>   [ Pid ! Msg || Pid<-Pids ].
> 
> less naive method:
> 
>   [ spawn(fun() -> [Pid ! Msg || Pid<-PidsSublist] end) ||
> PidsSublist <- partition(Pids, N) ].
> 
> where partition(L,N) splits list L into N sublists.
> 
> Any ideas for better method?
> 
> thanks,
> Zvi
> 
> ________________________________________________________________
> erlang-questions (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:erlang-questions-unsubscr...@erlang.org
> 

_______________________________________________
erlang-questions mailing list
erlang-questi...@erlang.org
http://erlang.org/mailman/listinfo/erlang-questions