Queue Manager performance tuning is probably one of the most important things to get right when using WebSphere MQ. Sometimes it is not easy to figure out what settings would work best for your install. In this post I will take you through some of the performance settings you can use when creating your queue managers.
Disclaimer: This information is used at your own risk, in no way do I accept responsibility for anything that goes wrong with your installation.
The options that I typically use for a performance setup are:
- -h – the number of handles that an application can have open at any one time.
- -lc – use circular logging for persistent messaging.
- -lf – the size of the log files (based on 4KB units).
- -lp – the number of primary log files to use.
Typically I will set -h to around 50000 which is more then my tests need, but ensures that I am not constrained to the 256 default. Using circular logging is advised, but be warned that long running transactions that span multiple log files can cause performance degradation to occur. The default log size is set at 1024 units of 4KB, which works out at 4MB of log. I typically set this value to 16384 which gives me a log file size of 64MB, big enough for my performance stress tests. -lp has a default of 3, again I increase this to be 16, giving me 16 log files, each 64MB in size.
The above give us a queue manager that can handle all the clients that I am going to throw at it, allows a large amount of space for persistent messages in the log files. Once the queue manager is created, we can edit parameters within the qm.ini (or Windows Registry) to get actual performance gains over a default installation.
There are a couple of values you can add to the TuningParameter stanza of the qm.ini file, DefaultQBufferSize and DefaultPQBufferSize. The default for nonpersistent queue buffer size (DefaultQBufferSize) is 64K per queue. The maximum that you can set this value is to 100MB, although I strongly advise you to make sure that you have enough real memory, as each queue would have 100MB of real memory (which could crash your machine!). For my performance measurements we use a much more realistic 1MB per queue, which provides us with ample space for our performance tests. Just to reiterate that setting this value in the qm.ini will affect each queue, make sure you have enough memory for the value you are setting! The changes in the qm.ini will only take effect after a queue manager restart. The setting for a persistent messaging buffer called DefaultPQBuffer size works in exactly the same way, your messages are still copied to a log, but if they are requested by a client and are still in the buffer then they will be read from there, rather then re-read from the logs.
In the Channels stanza of qm.ini MQIBindType can be set to: MQIBindType=FASTPATH which I understand from a technical perspective means that the channel processes are no longer separate from the queue manager processes. From a performance perspective I categorically know that this gives significant savings of CPU and memory resources compared to the default. The downside of this is that User Exits could corrupt the queue manager memory (if used), and it is also harder to diagnose problems with the channels. But from a pure performance perspective, this is a good option.
No doubt there are other parameters that we could use, increasing the number of channels, increase the number of maximum active channels, but the above parameters are the key ones that give my performance tests a big boost over the default settings when using JMS Client applications.
Update: Finished the post – see comments below.

11 comments
Comments feed for this article
February 5, 2007 at 4:46 am
glenbadd
These settings don’t really affect the Performance of a queue manager, they affect the Capacity and Recoverability. ie. How many does handles the app needs to function correctly? How much logging is required to meet the app recovery requirements (eg. long running units of work, size and volume of persistent messages) and what type (circular or linear) ?
MQ performance is generally very good ‘out of the box’ and is more dependent on the number of CPUs, real memory, disk speed, network interface capacity. etc. Check out the various MQ Performance evaluations at the IBM MQ Support Pacs page http://www-1.ibm.com/support/docview.wss?rs=171&uid=swg27007197 , starting at SupportPac MP6K.
Glenn.
February 6, 2007 at 9:45 am
Rich Cumbers
Hi Glenn,
You are quite correct, this post was not intended for public consumption in its current form……I was intending to continue the post with discussion about the parameters within the qm.ini file for unix based installations, which would also apply to the windows installations (within the registry). Please check back soon for an update to this post!
Cheers
Rich
February 6, 2007 at 10:16 am
Dale Lane
Whoops – that will be my fault then – sorry all! I hadn’t realised that it wasn’t ready when I flicked the switch for the site to go public.
Any chance to have a discussion about WMQ is always good though – as we say in the ‘About’ page, posts here are not intended to be definitive points of reference. The idea is to provide starting points for a discussion, and the more perspectives that can be included, the better.
Dale
February 14, 2007 at 5:34 pm
Rich Cumbers
Hi all,
Finally finished the post, sorry it took so long.
Rich
April 13, 2007 at 4:50 pm
Andrew Olson
It’s worth noting that the DefaultQBufferSize and DefaultPQBufferSize settings are only applied when a queue is first created. Changes to these settings require both a Queue Manager restart and the deletion and recreation of any existing queues that the settings need to be applied to.
June 12, 2007 at 5:29 pm
gtcarey
from: Andrew Olson
‘It’s worth noting that the DefaultQBufferSize and DefaultPQBufferSize settings are only applied when a queue is first created. Changes to these settings require both a Queue Manager restart and the deletion and recreation of any existing queues that the settings need to be applied to.’
I can understand a QMGR restart is needed but why in the world would a delete and recreate be needed for all/any queues to have a new DefaultQBufferSize and DefaultPQBufferSize settings to be recognized.
June 12, 2007 at 5:55 pm
gtcarey
Ii stumbled upon a tuning document … that appears to have been authored by Peter Toghill.. that answers my own previous question.
beginning of extract
‘Opening Queues
The queue definition is stored on DASD and is used to allocate resources at MQOpen. Queue
definitions may have been created with various values used for DefaultQBufferSize. Customers
who want two queues to have large values and the rest to take defaults, for example will start
the queue manager with the specified tuning parameters, create the two queues (definitions
stored on disk), and terminate the queue manager. The queue manager is then started without
the TuningParameter stanza, and the two queues previously defined with large values keep
their large values. Any subsequent queue definitions use the normal defaults. As each queue is
opened, the necessary resources are allocated depending on the DASD definition of the queue.’
end of extract
September 5, 2007 at 7:08 pm
Joseph Gramig
My question is, What if I have large and small messages going through the queue? Can I tune for the large messages? Will I have a performance issue for the small messages or just waste RAM?
January 25, 2008 at 12:26 am
Henry Steinhauer
Question on this – - So if we have test / stage mq system with 9,000 queues defined for the different testing threads that happen on a project, and if I have 1 MB set for the queue buffer size – then I would have 9 GB of space allocated just for queue buffers for these test queues ?
Even if they are not open – I have the threat that they might be opened – so I have to consider that I will have that much space allocated just for mq –
Do I have this right ?
January 25, 2008 at 2:26 pm
Rich Cumbers
Hi henry,
These buffers are used and allocated when you have the queue open, so if you were to have 9000 queues open at the same time then your overhead would be 9000 X your buffer size.
If you open a handle to a queue, and put messages to the queue, these will be held in the buffer. If you then close that handle then the buffer will be committed to real (disk) storage. This is overly simplified, but should do for the answer to this question.
So I guess you need to calculate the possibility that all 9000 queues will be open at the same time, and if this is the case, ensure that there is sufficient space available.
March 9, 2008 at 9:04 pm
Sudhir M
Hi
I am interested in the DefaultPQBufferSize paramater
Wondering are there any comparative stats on an average how much % performance would be gain by setting DefaultPQBufferSize when compare with just using the default.