Can anybody explain to me how msmq stores the messages on the hard drive?
I've seen the winnt\system32\msmq\storage directory that sometimes has more
than 90 MB in files with the nnnnnn.mp format.
My quetsion is:
Why types of messages are stored there? Only persistant messages? All
messages?
How can we purge that directory so MSMQ won't take 30 minutes when
initializing?
In a test, I sent more than 2000 persistent messages to an inexisten queue
using DIRECT=TCP format. I created more than 90 MB of files in the storage
directory. Then I went to the management console and Purged the outgoing
queue. Al 2000 messages went away, but the 90 MB of files remained there,
even though we restarted MQ. After an hour, we restarted MQ again, and it
deleted most of the files, but left 10 MB of files there.
I would like to understand how it works, to better troubleshoot in case we
have problems.
The whole issue started by MSMQ service taking 100% of CPU (actually 56%,
LSASS.EXE took the other 44%) for about 15 to 20 minutes. We thought it was
a mistake, but all of a sudden it came back to normal, and the previously 86
MB in the storage directory came down to 10 MB, so we tried to replicate the
situation and observed a pattern.
Please help me understand how this process work
Best regards,
Alex
Article ID: Q174307
INFO: Interpreting File Names in the Storage Directory
----------------------------------------------------------------------------
----
The information in this article applies to:
a.. Microsoft Message Queue Server (MSMQ) version 1.0
----------------------------------------------------------------------------
----
SUMMARY
This article describes the files in the Msmq\Storage and Msmq\Storage\Lqs
directories.
This information is useful, for example, if you want to manually inspect the
properties of a private queue or determine the disk space being used for the
storage of messages.
MORE INFORMATION
Files in the Msmq\Storage Directory
File names with an .mq extension represent memory-mapped files in which
messages are stored.
The .mq file name extension will be prefixed with a letter representing the
type of messages it is tracking:
r - Express messages (Note that express messages are normally held in RAM,
not disk. This file is used when there is no more available RAM.)
p - Persistent (recoverable) messages
j - Journal messages
l - Indexing bitmap for interpreting the journal or recoverable files.
NOTE: An .mq file does not identify or map to a unique queue. Messages from
multiple queues may be held in one .mq file, or messages from a single queue
may span multiple .mq files. A single message cannot span multiple files
(hence the 4 MB limit in size).
The QMLog file is a history of transactional message processing. When the
log is full, the oldest log data is overwritten as new entries are made.
To allow this continuous, cyclic writing to the QMlog, the state of
receiving ordered messages and the state of all active transactions is
periodically saved to the following files (respectively):
MQInSeqs.lg1
MQInSeqs.lg2
MQTrans.lg1
MQTrans.lg2
The .lg1 and .lg2 files are written to in an alternating pattern, to ensure
that one of the pair will persist if the other is damaged during a write.
Files in the Msmq\Storage\Lqs Directory
Files in this directory are text files that describe properties of the local
queues. They are accessed as an .ini file.
File names formatted nnnnnnnn.hhhhhhhh represent private queues. The
nnnnnnnn portion is the queue number (included in the direct format name for
the queue). The hhhhhhhh extension is a hash of the path name used for quick
lookup.
File names formatted aaaaaaaabbbbccccddddeeeeeeeeeeee.hhhhhhhh represent
local public queues. The 32 character portion of the file name to the left
of the period is the GUID of the queue. The hhhhhhhh extension is again a
hash of the path name.
"Alex" <no...@nowhere.com> wrote in message
news:eoNy9ad9AHA.1444@tkmsftngp05...
"Terry Young" <Terry...@peergroup.com> wrote in message
news:eKaj#i$9AHA.916@tkmsftngp04...
The MSMQ Queue Manager keeps alll queue data in a set of memory mapped
files. There isn't anything simple like a mapping from file to queue, data
in any of the QMs queues may appear in any of the files. Messages sent with
recoverable delivery force an IO to write that message's data onto the disk.
Messages sent with recoverable delivery generally will not be written onto
disk unless paging causes a piece of memory to be flushed to disk.
> How can we purge that directory so MSMQ won't take 30 minutes when
> initializing?
To mnimise overhead, the QM doesn't garbage collect its files every time a
message is removed from them. The default interval is six hours. You can
control this by setting the MESSAGECLEANUPINTERVAL registry key. See
Q199312 - PRB: Must Restart MSMQ Service to Cleanup Message Files
http://support.microsoft.com/support/kb/articles/Q199/3/12.ASP