Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #9981

Re: JMS scalability question

From Lew <lewbloch@gmail.com>
Newsgroups comp.lang.java.programmer
Subject Re: JMS scalability question
Date 2011-11-16 10:30 -0800
Organization http://groups.google.com
Message-ID <5890740.1493.1321468227592.JavaMail.geo-discussion-forums@prap37> (permalink)
References <bb8b61d2-fe1f-42b8-93d8-2d1a329e6afb@a16g2000yqk.googlegroups.com> <cch7c7lgr584uda3pemeeg5jlfhkdi8jnp@4ax.com> <5f805cc6-58b1-49e5-933f-4c6dbbceb65d@g7g2000vbd.googlegroups.com>

Show all headers | View raw


sax...@gmx.de wrote:
> thanks for your reply. I see what you mean. You would mostly play with
> control valves that are outside the software like adding servers or
> adding RAM.
> 
> Let's say there are 10 consumers and everyone takes messages from a
> queue exclusively assigned to itself. Consequently, there are 10
> queues in total. Now, each queue is filled with 100 messages each. I
> would expect these 1000 messages in total to be processed faster this
> way than, say, 1000 messages sitting in a single queue served by a
> single consumer. Naively speaking, those 10 consumers should eat up
> those 1000 messages 10 times faster. But this is pure mind gambling.

Yes, it is.  One wonders why you would expect ten consumers to be faster with ten queues than with one?  And what about data integrity?

In some scenarios, e.g., display-processing events for a GUI, element order matters.  How would you coordinate element order in ten parallel queues?

Ten consumers sipping off a single queue can be blazingly fast, if they grab from a concurrent queue and hare off in their own threads to process the data.  You still might face the event-order problem, of course.

> No clue how things would turn out in reality. Maybe the increased
> network traffic of 10 consumers polling a queue instead of a single
> one would decrease performance...

Maybe, but there's no particular reason to think so, or that if it exists such a penalty would be measurable.

> Do you think it would be useful to make the "message bus" pluggable in
> the sense that some SPI is provided so that anyone can increase the
> number of queues if considered appropriate? I wonder whether that kind
> of pluggable message bus system already exists. Guess it does since
> there must be a need for something like this.

One more consideration, based on many JMS-based systems I've seen in the wild: queues may be a very, very bad implementation for what you aim to accomplish.  What alternative architectures have you considered, and why were they inferior?

All your talk of what's faster this, and what's maybe slower than that, is wasted mental energy right now.  You don't even evince a basic architecture in your posts, which architecture must perforce conform to the logical problem you aim to solve.  Details of what number of them > 1, are so premature at this point.  First figure out even whether to use queues at all!

Also based on my experience, you really never need more than one JMS queue in each direction between communicating components.  Less than one, surely, but I can't recall needing more than one except in very, very rare, high volume circumstances.  We're talking millions of messages per hour per queue, not a piddling ten, before this becomes an issue.

-- 
Lew

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

JMS scalability question saxo123@gmx.de - 2011-11-15 02:07 -0800
  Re: JMS scalability question Roedy Green <see_website@mindprod.com.invalid> - 2011-11-16 06:21 -0800
    Re: JMS scalability question saxo123@gmx.de - 2011-11-16 09:35 -0800
      Re: JMS scalability question Lew <lewbloch@gmail.com> - 2011-11-16 10:30 -0800
        Re: JMS scalability question saxo123@gmx.de - 2011-11-16 14:25 -0800
          Re: JMS scalability question Lew <lewbloch@gmail.com> - 2011-11-16 17:18 -0800
            Re: JMS scalability question saxo123@gmx.de - 2011-11-16 22:59 -0800
              Re: JMS scalability question jlp <jlp@jlp.com> - 2011-11-17 08:41 +0100
                Re: JMS scalability question saxo123@gmx.de - 2011-11-17 01:00 -0800
      Re: JMS scalability question Roedy Green <see_website@mindprod.com.invalid> - 2011-11-16 16:16 -0800
  Re: JMS scalability question Fredrik Jonson <fredrik@jonson.org> - 2011-11-17 08:11 +0000
    Re: JMS scalability question saxo123@gmx.de - 2011-11-17 01:26 -0800
      Re: JMS scalability question Fredrik Jonson <fredrik@jonson.org> - 2011-11-17 21:01 +0000
        Re: JMS scalability question Saxo <saxo123@gmx.de> - 2011-11-17 23:27 -0800

csiph-web