Microsoft KB Archive/899612

= How to set up computer quotas and queue quotas in Microsoft Message Queuing =

Article ID: 899612

Article Last Modified on 7/25/2007

-

APPLIES TO


 * Microsoft Message Queuing 3.0
 * Microsoft Message Queuing 2.0

-





Important This article contains information about how to modify the registry. Make sure to back up the registry before you modify it. Make sure that you know how to restore the registry if a problem occurs. For more information about how to back up, restore, and modify the registry, click the following article number to view the article in the Microsoft Knowledge Base:

256986 Description of the Microsoft Windows registry



INTRODUCTION
This article discusses how to set up computer quotas and queue quotas that limit the amount of RAM that is available to Microsoft Message Queuing (also known as MSMQ) 3.0 and to Microsoft Message Queuing 2.0, and to individual queues.



MORE INFORMATION
The Message Queuing resource is not designed to be used as a database or as long-term RAM. If too many messages accumulate in individual queues in the Message Queuing resource, the volume of message may have an adverse effect on system performance. However, because the primary function of the Message Queuing resource is to provide asynchronous messaging, the Message Queuing resource can hold messages until the appropriate applications or clients can receive the messages.

The Message Queuing resource stores messages in memory-mapped files. The memory-mapped files are mapped to the amount of RAM that is available to the Message Queuing resource. On a Microsoft Windows 2000 Advance Server-based computer, the default amount of RAM that is available to the Message Queuing resource is 2 gigabytes (GB). After the components of the Message Queuing resource are loaded onto the computer, the amount of RAM that is available to the Message Queuing resource is reduced to approximately 1.6 GB.

If you enable the 3GB switch in the Boot.ini file, the amount of RAM that is available to the Message Queuing resource increases to 3 GB. After the components of the Message Queuing resource are loaded onto the computer, the amount of RAM that is available to the Message Queuing resource is reduced to 2.7 GB.

Note The limitation on the amount of RAM that is available to the Message Queuing resource does not apply to Message Queuing 3.0.

The Message Queuing resource uses approximately 70-80 bytes of RAM for every message. This is not a concern in Microsoft Message Queuing 1.0 or in Microsoft Message Queuing 2.0, where the volume of messages typically reaches a maximum size of between 1.6 GB and 1.8 GB before exhausting the available RAM. However, Message Queuing 3.0 running on a Microsoft Windows XP-based computer or on a Microsoft Windows Server 2003-based computer can accumulate enough messages for the RAM to be consumed by the Message Queuing Data Access (Mqac.sys) driver. When this problem occurs, system performance is affected.

Although this problem is rare, it may occur for one of the following reasons:
 * The computer or application that is reading from the Message Queuing resource has stopped.
 * The Message Queuing resource is not configured correctly.

For these reasons, we recommend the use of quotas.

Computer quotas and queue quotas
The Message Queuing resource uses the following two types of quotas:
 * Computer quotas
 * Queue quotas

Computer quotas limit the number of messages that are stored in destination queues, outgoing queues, and queue journals.

Queue quotas limit the number of bytes that are available for all messages that are stored in a particular queue.

To set up computer quotas for the Message Queuing resource or queue quotas for the Message Queuing resource, use one of the following methods.

Method 1: Set up a computer quota on a computer that has the Message Queuing resource installed in Domain Mode and that has Active Directory integrated
To set up a computer quota on a computer that has the Message Queuing resource installed in Domain Mode and that has Active Directory integrated, follow these steps:
 * 1) Click Start, point to Administrative Tools, and then click Computer Management.
 * 2) Click Services and Applications.
 * 3) Right-click Message Queuing, and then click Properties.
 * 4) Click to select the Limit message storage to (KB) check box.
 * 5) In the Amount of space box, enter the amount of kilobytes that you want to enable the Message Queuing resource to retain.
 * 6) Press OK to accept the changes. After you do this, the Properties dialog box will automatically close.

Method 2: Remotely set up a computer quota by using the Active Directory Users and Computers tool on a computer that has the Message Queuing resource installed in Domain Mode
To remotely set up a computer quota by using the Active Directory Users and Computers tool on a computer that has the Message Queuing resource installed in Domain Mode, follow these steps:

Note You must be logged onto a computer that is currently running the Message Queuing resource and that has the Active Directory management tools installed.  Open Active Directory Users and Computers, and then click the Computers folder that contains the computer that you are trying to manage. On the shortcut menu, click View, and then click Users, Groups, and Computers as containers. Open Active Directory Users and Computers again. On the View menu, click Advanced Features. Locate and then expand the name of the computer that you want to manage. The Message Queuing resource object should display an envelope icon.

Note If the envelope icon that is displayed is a default Windows icon, the Message Queuing resource is probably not installed on the computer that you are trying to access by using Active Directory.

 Right-click Message Queuing, and then click Properties.</li> Click to select the Limit message storage to (KB) check box.</li> In the Amount of space box, enter the limit of kilobytes that you want to enable the Message Queuing resource to retain.</li> Press OK to accept the changes. After you do this, the Properties dialog box will automatically close.</li></ol>

Method 3: Set up a computer quota on a computer that has the Message Queuing resource installed in Workgroup mode and that is not integrated with Active Directory
To set up a computer quota on a computer that has the Message Queuing resource installed in Workgroup mode and that is not integrated with Active Directory, follow these steps:

Warning Serious problems might occur if you modify the registry incorrectly by using Registry Editor or by using another method. These problems might require that you reinstall your operating system. Microsoft cannot guarantee that these problems can be solved. Modify the registry at your own risk. <ol> Click Start, click Run, type regedit, and then click OK.</li> Locate and then click the following key in the registry:

 

</li> On the Edit menu, click Modify.</li> Type amount of space, and then press ENTER. You must specify the amount of space in kilobytes.

Note You must restart the Message Queuing resource for these changes to take effect.</li></ol>

Method 4: Set up a queue quota
To set up a queue quota, follow these steps:
 * 1) Click Start, point to Administrative Tools, and then click Computer Management.
 * 2) Click Services and Applications.
 * 3) Click Message Queuing.
 * 4) Click to select Public if you want to set a quota on a public queue. Click to select Private if you want to set a quota on a private queue.

Note The next four steps are the same whether you are setting a quota on a public queue or on a private queue.
 * 1) Right-click Message Queuing, and then click Properties.
 * 2) Click to select the Limit message storage to (KB) check box.
 * 3) In the Amount of space box, enter the limit of kilobytes that you want to enable the Message Queuing resource to retain.
 * 4) Press OK to accept the changes. After you do this, the Properties dialog box will automatically close.
 * 5) Repeat steps 1 through 8 for all queues, such as dead letter queues and journal queues, on which you want to set up a quota.

Notes
 * You can also set up queue quotas on public queues by using the Active Directory Users and Computers tool. Use this tool similarly to how you used the tool in method 2 to set up a computer quota on a computer that has the Message Queuing resource installed in Domain Mode.
 * Setting up quotas is a best practice that may help you maintain system performance and prevent the loss of data.

<div class="references_section">