Reputation: 25631
I'm moving an application from one server to another and the new server returns the 'famous' - "Insufficient resources to perform operation." message when the code attempts to send multiple messages to a queue, the process is wrapped inside a transaction (TransactionScope). The old server executes the code correctly and all the messages (150 approx) are sent to the queue as expected, but the new server fails at apporx 27.
Now the message size is small and the number of messages on the queue is zero.
I've read the 'Insufficient Resources? Run away, run away!' article but I'm unsure how to change machine quotas for MSMQ.
The app log has the following entry:
System.Messaging.MessageQueueException (0x80004005): Insufficient resources to perform operation.
Technology is C# & .Net 4.0, server is win 2003 R2 SP2
Any ideas why I'm getting this?
Upvotes: 8
Views: 14787
Reputation: 1668
Just to add for issue number #7 storage space and Mitch's Answer.
Your quota size is the physical size on disk and not the queue reported size (as reported in apps like QueueExplorer or performance monitor).
So even though you have purged your queue you haven't actually removed them from disk (its meant to be cleaned every six hours)-
The default location is C:\Windows\System32\msmq\storage , or get it from the 1st link in Mitch's answer.
To clean up you can't just delete the files.
Try the below script (save as myScript.vbs). Run this as administrator from command prompt using:
cscript myScript.vbs
Option Explicit
Dim mqa
set mqa = WScript.CreateObject("MSMQ.MSMQApplication")
WScript.Echo "Bytes in all queues: " + CStr(mqa.BytesInAllQueues)
mqa.Tidy
WScript.Echo "MSMQ cleaned up"
After this our files dropped from 1Gb to about 50 mb even though the bytes in queues reported 40mb.
credit to thread: https://groups.google.com/forum/#!topic/microsoft.public.msmq.performance/jByfXUwXFw8
Upvotes: 4
Reputation: 25631
One of the message was exceeding the 4 Mb limit - once this was sorted everything worked as expected.
Upvotes: 8
Reputation: 300489
If it's the Quota problem (#7 in that article): Set the Message Storage Size for Computers
How to set up computer quotas and queue quotas in Microsoft Message Queuing
Administering Message Queuing Operations
Upvotes: 3