Using MSMQ quotas to improve startup time

With 64-bit operating systems, it is possible for MSMQ to hold a vast number of messages.

Some people think this is a good thing as it means MSMQ can wait out any network outages without running out of space. In the past with 32-bit systems, only a few million could be held before kernel memory became exhausted and MSMQ started to choke. Now the capacity is much, much higher.

There is a down side to this, though, and that appears as soon as you need to reboot a server that stores many millions of messages - it will take forever (or at least feel like it with the phone ringing off the hook as people demand to know when the system will be back up and running).

MSMQ needs to process every storage file and index every message - the more there are, the longer it will take. So if you have a service level agreement of, say, no more than 10 unplanned minutes off-line at any one time, you won't be able to meet it.

One approach is to set a system quota on MSMQ. The size of the quota would be the maximum volume of messages you could store and still load into memory within the desired time-frame. I can't give any figures for this as the times depend a lot on hardware performance so this needs to be benchmarked.