Microsoft Message Queue (MSMQ) limit and configuration best practice?

EnterpriseArchitect 4,826 Reputation points
2023-03-29T03:39:23.7566667+00:00

After reading this: https://learn.microsoft.com/en-us/previous-versions/windows/desktop/msmq/ms711436(v=vs.85).#maximum-message-size

I need some clarification regarding these:

  1. Is the directory limit size important for Windows Server 2016 and later?
  2. The maximum 4 MB size limit applies only to the message size, not the entire c:\windows\system32\msmq\storage is this true?
  3. The registry: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSMQ\Parameters\MachineCache\MachineQuota Can be used to extend the size of MSMQ total directory size in bytes.

Any assistance or clarification would be greatly appreciated.

Microsoft System Center
Microsoft System Center
A suite of Microsoft systems management products that offer solutions for managing datacenter resources, private clouds, and client devices.
842 questions
Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
12,208 questions
0 comments No comments
{count} votes

Accepted answer
  1. Limitless Technology 43,971 Reputation points
    2023-03-29T10:49:04.97+00:00

    Hello there,

    Yes 4Mb is only for messages.

    Messages can have no more than 4 MB of data. This restriction is due to the memory mapped files used by Message Queuing to store the message data. These memory-mapped files are stored in the MSMQ\Storage folder on the computer where the queue resides.

    The information within the message is stored in different message properties. For example, even the contents of the message (as described above) are stored in the body property of the message.

    Hope this resolves your Query !!

    --If the reply is helpful, please Upvote and Accept it as an answer--

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Ali Sufyan Butt 86 Reputation points MVP
    2023-04-13T12:07:29.13+00:00

    **I hope you find the answers helpful, do rate and mark as helpful if possible.

    As you asked that the directory limit size important for Windows Server 2016 and later?** Yes, the directory limit size is important for Windows Server 2016 and later. The maximum directory size limit is determined by the available disk space and can be configured using the registry settings. Then you asked that The maximum 4 MB size limit applies only to the message size, not the entire c:\windows\system32\msmq\storage is this true? Yes, that is correct. The maximum message size limit of 4 MB applies only to individual messages, and not to the entire storage directory. However, the total storage size limit is determined by the available disk space. Then you asked that the registry: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSMQ\Parameters\MachineCache\MachineQuota can be used to extend the size of MSMQ total directory size in bytes. Yes, that is also correct. The registry key you mentioned can be used to set the maximum size of the MSMQ directory in bytes. By default, the maximum directory size is determined by the available disk space, but you can set a specific maximum size using this registry key.

    1 person found this answer helpful.