Ayende @ Rahien

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

ayende@ayende.com

+972 52-548-6969

, @ Q c

Posts: 18 | Comments: 79

filter by tags archive

MSMQ: Insufficient resources to perform operation.

time to read 2 min | 330 words

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

  1. Production postmortem: The industry at large - 9 hours from now
  2. The insidious cost of allocations - about one day from now
  3. Buffer allocation strategies: A possible solution - 4 days from now
  4. Buffer allocation strategies: Explaining the solution - 5 days from now
  5. Buffer allocation strategies: Bad usage patterns - 6 days from now

And 2 more posts are pending...

There are posts all the way to Sep 11, 2015

RECENT SERIES

  1. Find the bug (5):
    20 Apr 2011 - Why do I get a Null Reference Exception?
  2. Production postmortem (10):
    01 Sep 2015 - The case of the lying configuration file
  3. What is new in RavenDB 3.5 (7):
    12 Aug 2015 - Monitoring support
  4. Career planning (6):
    24 Jul 2015 - The immortal choices aren't
View all series

Syndication

Main feed Feed Stats
Comments feed   Comments Feed Stats