Change the size of an IBM MQ queue file
We can increase or decrease the maximum size of a queue file.
Before starting
Before setting a new size for a queue file, use the DISPLAY QLOCAL command to see the size of the queue file we want to change. For example, issue the following command:DISPLAY QLOCAL(SYSTEM.DEFAULT.LOCAL.QUEUE) MAXFSIZEYou receive the following output:AMQ8409I: Display queue details QUEUE(SYSTEM.DEFAULT.LOCAL.QUEUE) TYPE(QLOCAL) MAXFSIZE(DEFAULT)which shows that the maximum size of the queue file is the default value of 2,088,960 MB.
About this task
The following procedures show you how to:
- Reduce the maximum size that a queue file can grow to.
- Increase the maximum size that a queue file can grow to.Attention: We should be cautious of increasing the size of queue files without considering the way that the applications are written and the possible effect on performance. Accessing messages at random in a very large queue file can be very slow.
If we are considering increasing the maximum size of a queue file beyond the default we should be cautious of using message selectors such as correlation IDs and IBM MQ classes for JMS selector strings. Larger queue files are better suited to first-in first-out access to the queue.
Having very large amounts of data in individual queue files should only be done on queue managers that are configured for circular logging, or where media imaging has not been enabled for the individual queue.
We should not limit the size of SYSTEM queues as this could affect the operation of the queue manager.
Procedure
- Reduce the maximum queue file size
- Issue the following command to create a local file called SMALLQUEUE, with a size of 500 gigabytes :
DEFINE QLOCAL(SMALLQUEUE) MAXFSIZE(512000) 2 : DEFINE QLOCAL(SMALLQUEUE) MAXFSIZE(512000) AMQ8006I: IBM MQ queue createdand you receive message: AMQ8006I: Note: If you configure a queue with a value smaller than the amount of data already in the file, new messages cannot be put to the queue.If an application attempts to put a message to a queue file that does not have sufficient space, the application receives the return code MQRC_Q_SPACE_NOT_AVAILABLE. When enough messages are destructively read from the queue, applications can begin to put new messages to the queue.
- Increase the maximum queue file size.
- Issue the following command to create a local file called LARGEQUEUE, with a size of 5 terabytes:
DEFINE QLOCAL(LARGEQUEUE) MAXFSIZE(5242880) 3 : DEFINE QLOCAL(LARGEQUEUE) MAXFSIZE(5242880) AMQ8006I: IBM MQ queue created
Parent topic: Modifying IBM MQ queue files