Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 37503 invoked from network); 28 Apr 2009 03:05:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 28 Apr 2009 03:05:16 -0000 Received: (qmail 35187 invoked by uid 500); 28 Apr 2009 03:05:15 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 35114 invoked by uid 500); 28 Apr 2009 03:05:15 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 35104 invoked by uid 99); 28 Apr 2009 03:05:14 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Apr 2009 03:05:14 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of ammulder@gmail.com designates 74.125.46.155 as permitted sender) Received: from [74.125.46.155] (HELO yw-out-1718.google.com) (74.125.46.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Apr 2009 03:05:08 +0000 Received: by yw-out-1718.google.com with SMTP id 4so198910ywq.86 for ; Mon, 27 Apr 2009 20:04:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=x0H0/J+Ow6IkVBXLjTqpLnDwHNCZl2xc3/isInMZV04=; b=Rjbw17Fg/oEcL/VKDdJp2AAW68GEUQCVEh7rZFFTTcjO+qk1oy7/NEQjjhqfw4Jybj avD/tAumrtOqgESok0Mw8dXDUoCA9v9IVSW+yepe+HmfpUfVvn1flFpmUp3wQ5uJf+g+ QoJ4VvJTc2milZjps/f6xOE73GPKev8WQ61+c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type:content-transfer-encoding; b=DYN4SPgFkbixS2/mYOiUj+nJJQk0eJXFihmdKIRdNh+0q6KG2M7fFUhA+CA/8yA52S mHLnjpberTQRwuBse3yI/9OdqPCBzlT1zZV+Hjgim9XpYEMwLrUzA6+H/Kfvv1iBmOEE JuahZbLq+d+JLa0/1Ni9DzyHzUhVr1dRUZII8= MIME-Version: 1.0 Sender: ammulder@gmail.com Received: by 10.151.128.1 with SMTP id f1mr11409743ybn.36.1240887887031; Mon, 27 Apr 2009 20:04:47 -0700 (PDT) Date: Mon, 27 Apr 2009 23:04:47 -0400 X-Google-Sender-Auth: a397e14d3392e27d Message-ID: <74e15baa0904272004m4d7d39faj5710bb771eb0723b@mail.gmail.com> Subject: Performance of high number of topics or selectors From: Aaron Mulder To: users@activemq.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Let's say I have 100,000 stock tickers (or whatever) I want to track, each with a separate client. There seem to be two approaches -- putting them all in one topic and having each of the clients use a selector (ticker equivalent in a header property), or putting messages for each header on it's own topic and subscribing each consumer to one dedicated topic. When I try this, the performance stinks. With the selector approach it takes as long as like 10 minutes for 100,000 clients to connect (using the VM transport), I need more than 256 MB of heap (512 was fine but 384 might have been OK), and the message send/receive time seems to go up more or less linearly with the number of clients (like, .5 seconds for 1000 clients, 5s for 10,000 clients, 75s for 100,000 clients, all for 1000 messages). My actual selector used two header properties, but you get the idea. With the topic approach, which I assumed would perform better on account of eliminating the selectors, the persistent store blew out file handles and crashed, so I disabled persistence for the test. (Is there a disk-based store that doesn't keep an open file for each topic?). With that out of the way, it seemed OK up to 10,000 clients (and up to 3x as fast for message send/receive), but isn't really able to connect 100,000 clients each to a different topic. Like, the first 40K took 20 minutes, and the it pretty much hit the limit of 512 heap and the next 2K took 15 minutes of which at least 12 was in GC, etc. I'm not sure how high I'm willing to push the heap, but over 1 GB seems out of line when I haven't sent any messages yet. Anyway, this wasn't really what I had hoped for. Is there some good way to customize the configuration to either handle ~100K selectors really optimally, or ~100K topics really optimally? Or would it just be better to have one topic where every client gets every message and manually discards the ones it doesn't care about? I haven't tried that yet. Thanks, Aaron