2
votes

In Websphere MQ, we can easily find out that how many messages are there in a local queue using CURDEPTH attribute of the queue.

But how can I find the actual disk space taken by these messages? As messages in the queue might be of different size i.e. they may take different disk space.

Thanks in advance.

3

3 Answers

1
votes

The name of the "queue" file on the disk does not map exactly to the queue name.

  1. For normal queues created with older version of IBM MQ the file would be called q in the directory /var/mqm/qmgrs/QMGR/queues/QUEUE_NAME where the . character in the queue name is replaced with !.
  2. For normal queues created with newer versions of MQ (I believe 7.5 and later) the actual file is called /var/mqm/qmgrs/QMGR/queues/QUEUE_NAME where the . character in the queue name is replaced with !, it is no longer a directory with a file called q.
  3. For dynamic queues the directory or file name will not contain the actual dynamic queue name at all and will be similar to !!GHOST!DEADBEEF!0!DEADBEEF!99.

To find the exact location of the queue file use the dspmqfls command as in the example below:

dspmqfls -m QMGR -t ql SYSTEM.DEFAULT.LOCAL.QUEUE

The output will look like this:

WebSphere MQ Display MQ Files

QLOCAL    SYSTEM.DEFAULT.LOCAL.QUEUE
/var/mqm/qmgrs/QMGR/queues/SYSTEM!DEFAULT!LOCAL!QUEUE

Note that the output is the same no matter if the location is a directory or the actual file. If you check and it is a directory you can look in the directory for the file named q, if it is a file that is the actual "queue" file.

Example of a queue Directory:

$ls -ld /var/mqm/qmgrs/QMGR/queues/SYSTEM!DEFAULT!LOCAL!QUEUE
drwxrwx--- 2 mqm mqm 96 Apr  7  2010 /var/mqm/qmgrs/QMGR/queues/SYSTEM!DEFAULT!LOCAL!QUEUE

Example of a queue File:

$ls -ld /var/mqm/qmgrs/QMGR/queues/SYSTEM!DEFAULT!LOCAL!QUEUE
-rw-rw---- 1 mqm mqm 2048 Jul 19 2016 /var/mqm/qmgrs/QMGR/queues/SYSTEM!DEFAULT!LOCAL!QUEUE

NOTE APAR IT09611 which applies to IBM MQ v7.5.0.0 through 7.5.0.5 can cause some queue file names to be truncated, this is fixed in 7.5.0.6.

0
votes

You look at the size of the queue file to determine the disk space taken by all messages in a queue. Queue file will be located under /qmgrs//queues folder. Queue file name will be same as the queue name.

0
votes

Thanks Shashi. For others, the full path of the queue file is /var/mqm/qmgrs/QMANAGER_FOLDER/queues/QUEUE_You_Want/q

QMANAGER_FOLDER - The Queue Manager directory
QUEUE_You_Want - The Queue , you are looking for.

The size of file 'q' will be enough to determine the total disk space taken by the queue. So, in case of a file system gets full due to some queue messages, we can determine which queue is taking how much disk space from here.