[rabbitmq-discuss] Performance question

Alexis Richardson alexis.richardson at gmail.com
Tue May 26 20:05:58 BST 2009


Roshan

The easiest way to increase performance is to change what you are measuring ;-)

Here is an analysis of the tests you are referring to.  Note that a 16
core machine was used, plus some compression and batching using
OPRA/FAST.  Also the rates are ingress plus egress (fanout ratio of
4).  This is very different from the case you describe which appears
to be a single stream.  10k mps ingress per core isn't bad.  Why don't
you try using a fanout exchange to increase the message output from
the broker?  Another tip is to use a C client.  The Java client may
limit you.

Let us know how you get on.

alexis




On Tue, May 26, 2009 at 5:31 PM, Roshan Punnoose
<rpunnoose at proteus-technologies.com> wrote:
> I have a one producer, one consumer queue running locally for a performance
> test. In terms of just server and client configuration, what is the best way
> to increase performance. For a simple queue publisher and consumer, I’m
> getting about 10k a second for simple byte messages.
>
> Here is some of the code:
>
> Publisher:
> channel.exchangeDeclare("exchangename", "direct");
>                    channel.queueDeclare("queuename");
>                    channel
>                            .queueBind("queuename", "exchangename",
>                                    "routingKey");                    byte[]
> messageBodyBytes = new byte[0];                    int count = 0;
>                    long start = System.currentTimeMillis();
>                    String name = Thread.currentThread().getName();
>                    for (int i = 0; i < 100000; i++) {
>                        channel.basicPublish("exchangename", "routingKey",
>                                null, messageBodyBytes);
>                        count++;                        if
> ((System.currentTimeMillis() - start) > 1000) {
>                            System.out.println(name + "-" + count);
>                            count = 0;                            start =
> System.currentTimeMillis();                        }                    }
>
>
> Consumer:
> channel.basicConsume("queuename", false, new DefaultConsumer(channel) {
>            int count = 0;            long start =
> System.currentTimeMillis();            @Override            public void
> handleDelivery(String consumerTag, Envelope envelope,
>                    BasicProperties properties, byte[] body) throws
> IOException {                count++;                if
> ((System.currentTimeMillis() - start) > 1000) {
>                    System.out.println(count);                    count = 0;
>                    start = System.currentTimeMillis();                }
>                this.getChannel().basicAck(envelope.getDeliveryTag(), false);
>            }        });
>
> Is there some way I can increase the performance? From the tests I have seen
> online, I hear numbers of millions of messages a second.
>
> Roshan
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>
>


More information about the rabbitmq-discuss mailing list