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: 5,969 | Comments: 44,490

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)
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.


No future posts left, oh my!


  1. Production postmortem (5):
    29 Jul 2015 - The evil licensing code
  2. Career planning (6):
    24 Jul 2015 - The immortal choices aren't
  3. API Design (7):
    20 Jul 2015 - We’ll let the users sort it out
  4. What is new in RavenDB 3.5 (3):
    15 Jul 2015 - Exploring data in the dark
  5. The RavenDB Comic Strip (3):
    28 May 2015 - Part III – High availability & sleeping soundly
View all series



Main feed Feed Stats
Comments feed   Comments Feed Stats