“资源不足,无法执行操作。”当事务包含多条消息时的 MSMQ
我正在将应用程序从一台服务器移动到另一台服务器,新服务器返回“著名”-“资源不足,无法执行操作”。当代码尝试向队列发送多条消息时,该过程将被包装在事务 (TransactionScope) 内。旧服务器正确执行代码,所有消息(大约 150 条)都按预期发送到队列,但新服务器在大约 27 处失败。
现在消息大小很小,队列上的消息数量为零。
我已阅读“资源不足?逃走,逃走!' 文章,但我不确定如何更改 MSMQ 的计算机配额。
应用程序日志具有以下条目:
System.Messaging.MessageQueueException (0x80004005): 资源不足,无法执行操作。
技术是 C# & 技术。 .Net 4.0,服务器是 win 2003 R2 SP2
有什么想法为什么我会得到这个吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
其中一条消息超出了 4 Mb 限制 - 一旦排序,一切都会按预期进行。
One of the message was exceeding the 4 Mb limit - once this was sorted everything worked as expected.
只是添加第 7 期的存储空间和 Mitch 的答案。
您的配额大小是磁盘上的物理大小,而不是队列报告的大小(如 QueueExplorer 或性能监视器等应用程序中报告的)。
因此,即使您已经清除了队列,您实际上并没有从磁盘中删除它们(它意味着每六个小时清理一次) -
默认位置是 C:\Windows\System32\msmq\storage ,或者从第一个链接获取它在米奇的回答中。
要清理,您不能只删除文件。
尝试以下脚本(另存为 myScript.vbs)。
使用以下命令以管理员身份从命令提示符运行此命令:
cscript myScript.vbs
此后,我们的文件从 1Gb 下降到大约 50 mb,尽管队列中的字节报告为 40 mb。
归功于帖子:https://groups.google.com /forum/#!topic/microsoft.public.msmq.performance/jByfXUwXFw8
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
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
如果是配额问题(该文章中的#7):设置计算机的消息存储大小
如何在 Microsoft 消息队列中设置计算机配额和队列配额< /a>
管理消息队列操作
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