[rabbitmq-discuss] dropped messages

smittycb10 msmith1638 at gmail.com
Fri May 22 15:42:54 BST 2009


I am still having problems, when I run the client program on the server I am
getting the same degraded numbers as when run across the network. Some
details:
I am publishing about 4000 message per second to a direct exchange via the
.NET client, however I am only receiving about 10% of these messages on the
client subscription side.


My publish code looks like this:

Properties 
 if (m_RabbitProperties == null) 
      {
        m_RabbitProperties = m_RabbitChannel.CreateBasicProperties();
        m_RabbitProperties.AppId = "RemoteMIS";
        m_RabbitProperties.DeliveryMode = 1;
        m_RabbitProperties.Expiration = "1000";
      }

creating the channel:
 if (m_RabbitConnec == null)
        m_RabbitConnec = new
ConnectionFactory().CreateConnection(AMPQ_SERVER);

      if (m_RabbitChannel == null)
        m_RabbitChannel = m_RabbitConnec.CreateModel();


publishing the message:
 m_RabbitChannel.BasicPublish("quotes", "quotes", true, true,
m_RabbitProperties, packet);
//note queue and exchange name are the same:

Exchanges are set up as follows with the subscription pattern:
  using (IConnection conn = new
ConnectionFactory().CreateConnection(rabbitBroker)) 
      {
        using (IModel channel = conn.CreateModel()) 
        {
          Subscription sub = new Subscription(channel, "quotes", "direct",
"quotes");
          foreach (BasicDeliverEventArgs ev in sub) 
          {
           
            int totalLength = ev.Body.Length / MISQuote.misQuoteSz;
            int index = 0;
           /**
            * process the message
            **/
            sub.Ack(ev);
          }
        }
      }

What am I doing wrong??
Thanks
Mark

Matthias Radestock-2 wrote:
> 
> Mark,
> 
> smittycb10 wrote:
>> It seems that my biggest problem was understanding the difference between
>> a
>> '#' and '*' in the routing key. Expect to see better results tomorrow.
> 
>> Would appreciate some performance tuning tips or pointers to
>> documentation
>> on this subject.
> 
> Here are a few tips of how to get the best performance out of AMQP:
> 
> - avoid topic exchanges if you can. Most use cases only need direct or 
> fanout exchanges, which are much more efficient. It is a common 
> misconception that direct exchanges only route messages to at most one 
> queue. That is not the case; they can route messages to multiple queues.
> 
> - on the consuming side, use basic.consume instead of basic.get, and 
> turn on 'no-ack' (thus eliminating the need to send acks), if your 
> application semantics permit that.
> 
> - avoid creating lots of exchanges. A common mistake, again mostly due 
> to misunderstanding about how direct exchanges work, is to create pairs 
> of exchanges and queues when a single exchange with lots of queues would 
> suffice. While RabbitMQ is perfectly happy with high exchange counts, 
> and the number of exchanges has little or no impact on routing 
> performance, exchange creation/deletion operations themselves are quite 
> expensive.
> 
> 
> Beyond that, RabbitMQ and the underlying Erlang/OTP runtime can be tuned 
> to a degree. Plus the OS, in particular the network stack. In practice 
> though most users get good enough performance with the standard settings.
> 
> 
> Regards,
> 
> Matthias.
> 
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
> 
> 

-- 
View this message in context: http://www.nabble.com/dropped-messages-tp23659084p23671830.html
Sent from the RabbitMQ mailing list archive at Nabble.com.





More information about the rabbitmq-discuss mailing list