Posted by: ibmadmin | September 23, 2011

Increasing the Maximum Message Size (MAXMSGL) for IBM Websphere MQ

We might have to handle big messages during our day today transaction like big email attachment going through the IBM Websphere MQ queues. In this case, we need to consider the message size do make the transaction successful. The default maximum message size for a queue in the IBM Websphere MQ is 4MB. This is optimized for most of the transaction. But for some case, we may need to handle email attachment, big size pdf documents and other big hash maps in the transactions. This leads us to use the queue which should handle big size messages, since we need to consider the MAXMSGL i.e. maximum message size attribute for a particular queue.

In general, if we try to post a big messages to the queue which can handle up to 4MB (default max message size), then we will get an MQ reason code of 2030.
MQRC: 2030 (MQRC_MSG_TOO_BIG_FOR_Q)
4MB = 1024 (1KB) * 1024 (1KB) * 4 = 4194304 Byte
The upper limit for any queue in IBM Websphere MQ is 100MB in Version 7.0. In most of the cases, 100MB will be huge enough to handle all of our requirements. The MAXMSGL attribute will impact the queue manager performance due to the following parameter.
1channel batch size
2. logging capacity of the queue manager
3. sync point for the queue manager messages
4. Mainly on the disk space of the /var/mqm file system which stores the messages for all of our transactions. So the disk space need to be calculated based on the maximum message count (MAXDEPTH) multiply by the maximum message size (MAXMSGL) attribute of queue. For example if we are going to store 20MB message with the maximum count of 10000 then we may need to have 200GB disk space it is too huge for a normal trasactions. So this might impact the system in a negative way.
5. If the queue manager shutdown abnormally, then the big messages will take more time to recover during the queue manager start up time.
With the above warnings, we need to increase the maximum message size (MAXMSGL) queue attribute. We can configure a particular queue to handle the maximum message requirement or we can configure the whole queue manger objects to handle the big messages. We will see how to configure these below.

First we will consider how to configure one particular queue to handle big messages. In this case we need to consider all the MQ object which involve in this transaction. If it is distributed or clustered MQ architecture, then we need to consider those object which forms the clustering environment. The following steps help us to make the QL1 queue to handle 11MB message in a clustered environment. If it is distributed architecture, then consider the sender and receiver channel instead of Cluster Sender and Cluster Receiver channels and their respective transmission and remove queues.

*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MQSC Commands Starts Here ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

*===================== Queue Manager Names: TEST_CLUSTER_QM1 & TEST_CLUSTER_QM2 =================================
*———————- The queue which needs to be altered for the maximum message size is QL1, the message size is 11MB (1024 * 1024 *11 = 11534336)
*———————– The Server Connection Channel used to communicate with the Queue QL1 is JAVA_APPS.SVRCONN
*———————–Cluster sender and receiver channels TO.TEST_CLUSTER_QM2.CLUSTER & TO.TEST_CLUSTER_QM1.CLUSTER
*———————-Execute the following commands on both queue managers
ALTER QMGR MAXMSGL(11534336)

*—————————————————–
ALTER QLOCAL(QL1) MAXMSGL(11534336)
*—————————————————–
ALTER CHANNEL(JAVA_APPS.SVRCONN) CHLTYPE(SVRCONN) MAXMSGL(11534336)

dis chs(‘JAVA_APPS.SVRCONN’)

dis CHANNEL(JAVA_APPS.SVRCONN)

*============================================================================================

*Execurte the following mqsc commands in TEST_CLUSTER_QM1 queue manager:
*——————————————————————————

dis chs(‘TO.TEST_CLUSTER_QM2.CLUSTER’)
dis CHANNEL(‘TO.TEST_CLUSTER_QM2.CLUSTER’)

STOP CHANNEL (‘TO.TEST_CLUSTER_QM2.CLUSTER’)
ALTER CHANNEL (‘TO.TEST_CLUSTER_QM2.CLUSTER’) CHLTYPE(CLUSSDR) MAXMSGL(11534336)
START CHANNEL (‘TO.TEST_CLUSTER_QM2.CLUSTER’)
dis chs(‘TO.TEST_CLUSTER_QM2.CLUSTER’)
dis CHANNEL(‘TO.TEST_CLUSTER_QM2.CLUSTER’)

dis chs(‘TO.TEST_CLUSTER_QM1.CLUSTER’)
dis CHANNEL(‘TO.TEST_CLUSTER_QM2.CLUSTER’)

STOP CHANNEL (‘TO.TEST_CLUSTER_QM1.CLUSTER’)
ALTER CHANNEL (‘TO.TEST_CLUSTER_QM1.CLUSTER’) CHLTYPE(CLUSRCVR) MAXMSGL(11534336)
START CHANNEL (‘TO.TEST_CLUSTER_QM1.CLUSTER’)
dis chs(‘TO.TEST_CLUSTER_QM1.CLUSTER’)
dis CHANNEL(‘TO.TEST_CLUSTER_QM2.CLUSTER’)
*============================================================================================

*Execute the following mqsc commands in TEST_CLUSTER_QM2 queue manager:
*——————————————————————————
dis chs(‘TO.TEST_CLUSTER_QM2.CLUSTER’)
dis CHANNEL(‘TO.TEST_CLUSTER_QM2.CLUSTER’)

STOP CHANNEL (‘TO.TEST_CLUSTER_QM2.CLUSTER’)
ALTER CHANNEL (‘TO.TEST_CLUSTER_QM2.CLUSTER’) CHLTYPE(CLUSRCVR) MAXMSGL(11534336)
START CHANNEL (‘TO.TEST_CLUSTER_QM2.CLUSTER’)
dis chs(‘TO.TEST_CLUSTER_QM2.CLUSTER’)
dis CHANNEL(‘TO.TEST_CLUSTER_QM2.CLUSTER’)

dis chs(‘TO.TEST_CLUSTER_QM1.CLUSTER’)
dis CHANNEL(‘TO.TEST_CLUSTER_QM2.CLUSTER’)

STOP CHANNEL (‘TO.TEST_CLUSTER_QM1.CLUSTER’)
ALTER CHANNEL (‘TO.TEST_CLUSTER_QM1.CLUSTER’) CHLTYPE(CLUSSDR) MAXMSGL(11534336)
START CHANNEL (‘TO.TEST_CLUSTER_QM1.CLUSTER’)

dis chs(‘TO.TEST_CLUSTER_QM1.CLUSTER’)
dis CHANNEL(‘TO.TEST_CLUSTER_QM2.CLUSTER’)

*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MQSC Commands Ends Here ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Make sure the cluster sender and cluster receiver channels are running after you made the changes. This ensure that the QL1 can handle up to 10MB messages (10MB for the pay load and 1MB for the MQMD header information) during your transaction.

In other case, if you want to make the all queue manager object to handle big size messages, then we can make all system object MAXMSGL attribute to the desired maximum message size. Following the steps in the http://www-01.ibm.com/support/docview.wss?uid=swg21420754 link which help you to make the complete queue manger object to handle the big size messages. We need to note that there will be big performance impact due to this change.
So by making the above changes we can avoid the 2030 (MQRC_MSG_TOO_BIG_FOR_Q) error message in the code.

Ref Link:   http://www-01.ibm.com/support/docview.wss?uid=swg21420754

 

Advertisements

Responses

  1. Does MAXMSGL really impact the performance or is it the actual message size that will impact the performance ?
    I.e. if we do not change the actual message size (let’s say 1MB) but that we increase the MAXMSGL to its maximum value which is 100 MB, will it impact the performance ?


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: