Ayende @ Rahien

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


+972 52-548-6969

, @ Q c

Posts: 6,124 | Comments: 45,475

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)
var queue = new MessageQueue(@".\private$\MyQueue");
test msg");

catch (Exception 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.



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.


  1. The design of RavenDB 4.0: Making Lucene reliable - 6 hours from now
  2. RavenDB 3.5 whirl wind tour: I’ll find who is taking my I/O bandwidth and they SHALL pay - about one day from now
  3. The design of RavenDB 4.0: Physically segregating collections - 2 days from now
  4. RavenDB 3.5 Whirlwind tour: I need to be free to explore my data - 3 days from now
  5. RavenDB 3.5 whirl wind tour: I'll have the 3+1 goodies to go, please - 6 days from now

And 13 more posts are pending...

There are posts all the way to May 30, 2016


  1. RavenDB 3.5 whirl wind tour (14):
    02 May 2016 - You want all the data, you can’t handle all the data
  2. The design of RavenDB 4.0 (13):
    28 Apr 2016 - The implications of the blittable format
  3. Tasks for the new comer (2):
    15 Apr 2016 - Quartz.NET with RavenDB
  4. Code through the looking glass (5):
    18 Mar 2016 - And a linear search to rule them
  5. Find the bug (8):
    29 Feb 2016 - When you can't rely on your own identity
View all series



Main feed Feed Stats
Comments feed   Comments Feed Stats