[rabbitmq-discuss] High CPU Usage

Bryan Murphy bmurphy1976 at gmail.com
Wed Dec 30 23:25:57 GMT 2009


I want to set up 3 queues, High, Medium, and Low where I always pull
messages from the higher priority queues first.  Right now, I more or less
do the following:

while (true)
{
  result = null;

  foreach (var queue in queues)
  {
    result = model.BasicGet(queue, false);

    if (result != null)
      break;
  }

  if (result != null)
    DoSomething(result);

  Thread.Sleep(15); // 15ms
}

Functionally this achieves what I'm trying to accomplish, however, the CPU
usage of the RabbitMQ server goes through the roof once I spin up a few
listeners.

Is there another way I can accomplish the same thing that doesn't hit the
RabbitMQ server so hard?

Thanks,
Bryan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20091230/f3ef194f/attachment.htm 


More information about the rabbitmq-discuss mailing list