Ayende @ Rahien

Hi!
My name is Ayende Rahien
Founder of Hibernating Rhinos LTD and RavenDB.
You can reach me by phone or email:

ayende@ayende.com

+972 52-548-6969

@

Posts: 5,947 | Comments: 44,540

filter by tags archive

MSMQ: Insufficient resources to perform operation.


I run into an annoyingly persistent error on a production server:

System.Messaging.MessageQueueException: Insufficient resources to perform operation.
at System.Messaging.MessageQueue.SendInternal(Object obj, MessageQueueTransaction internalTransaction, MessageQueueTransactionType transactionType)
at System.Messaging.MessageQueue.Send(Object obj)
at ConsoleApplication1.Program.Main(String[] args)

This was generated from the following code:

class Program
{
static void Main(string[] args)
{
try
{
var queue = new MessageQueue(@".\private$\MyQueue");
queue.Send("
test msg");
Console.WriteLine("
success");

}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}

The error was happening on all queues, and persisted even after rebooting the machine. I should mention that we had a runaway message generation, and we have queues with lots of messages currently.  The queue that I was trying to send the message to was empty, however. And there was no reading/writing on the queues.

Nasty issue to figure out, I was pointed to this post, and indeed, suggestion #7 was it, we run over the machine quota for MSMQ, so it started rejecting messages.

No one really thought about it, because we never set the quota, but it seems that by default there is a 1GB quota for the entire machine. This is usually more than enough to handle things, I would assume, but when you run into a convoy situation, bad things will happen.


Comments

RichB

WinXp does not have these MSMQ machine quotas. Win2K3 and up does. Also, I believe you have to be a domain admin to even see the property pages for MSMQ to edit this setting!

Ronald S Woan

Another good post: http://support.microsoft.com/kb/899612

An additional interesting thing is that I think at least previous to Windows 2008, MSMQ stored or memory mapped messages in the filesystem, so we had a antivirus on a system that didn't have the right exclusions that just tanked performance.

Also you can set quotas for defined inbound queues, but I didn't see how to set them for outbound queues, so I tune the static queue quotas to reserve space under the machinequota limit to accomodate some amount of outbound.

Tyler Burd

This bit me, too, when I turned on journaling for certain queues. A few weeks later everything suddenly stopped working because the journal also apparently contributes to the 1GB limit. Ugh.

Chris Ortman

Was it a bunch of DateTime messages? I ran this once as well and that was what was happening. Never did figure out why all those messages got sent tho

Comment preview

Comments have been closed on this topic.

FUTURE POSTS

No future posts left, oh my!

RECENT SERIES

  1. RavenDB Sharding (2):
    21 May 2015 - Adding a new shard to an existing cluster, the easy way
  2. The RavenDB Comic Strip (2):
    20 May 2015 - Part II – a team in trouble!
  3. Challenge (45):
    28 Apr 2015 - What is the meaning of this change?
  4. Interview question (2):
    30 Mar 2015 - fix the index
  5. Excerpts from the RavenDB Performance team report (20):
    20 Feb 2015 - Optimizing Compare – The circle of life (a post-mortem)
View all series

RECENT COMMENTS

Syndication

Main feed Feed Stats
Comments feed   Comments Feed Stats