IBM Support

Finding the number of running channels

Question/Answer


Question

How do I determine the number of channels that are running for my queue manager?

Cause

You want to monitor your queue manager and try to avoid the following message, which indicates that the maximum number of channels has been reached.

AMQ9513: Maximum number of channels reached.

Answer


UNIX

In UNIX systems, you can enter the following compound commands.
Ensure to replace CHLNAME and QMGR with the proper values for your system:

a) To query for all channels:
echo "DISPLAY CHSTATUS(*)" | runmqsc QMGR | grep 'AMQ8417' | wc -l

b) To query for a specific channel, such as CHLNAME:
echo "DISPLAY CHSTATUS(CHLNAME)" | runmqsc QMGR | grep 'AMQ8417' | wc -l

Notes:
1) The parameter for "wc" (word count) is -l (lowercase letter L)
2) Why counting the instances of AMQ8417?
Because it is shown for every channel. Thus, if there are 10 channels, then there are 10 such message ids.
.
DISPLAY CHSTATUS(*) ALL
AMQ8417: Display Channel Status details.
   CHANNEL(X)              CHLTYPE(SVRCONN)
...
AMQ8417: Display Channel Status details.
   CHANNEL(Y)              CHLTYPE(SVRCONN)


Windows

For Windows, there are no "grep" and no "wc" command, but "find" can be used instead to find and count:

echo DISPLAY CHSTATUS(*) | runmqsc QMGR | find /c "AMQ8417"

Notes about the Windows "find" command:
- The command requires the string to be searched to be specified between double quotes, otherwise you will get an error: FIND: Parameter format not correct
- The flag /c counts the number of lines in which the string appears. Similar to the UNIX command: wc -l


IBMi

From command line, type:
1. QSH (to access the shell environment)
2. echo "DISPLAY CHSTATUS(*)" | /qsys.lib/qmqm.lib/runmqsc.pgm QMGR | grep 'AMQ8417' | wc -l

NOTE: This returns the value of the number of active channel connections

 

+++ Miscellaneous notes on MaxChannels

On Distributed platforms the default value for MaxChannels is 100.

A system that is busy serving connections from the network might need a higher number than the default setting. Determine the value that is correct for your environment, ideally by observing the behavior of your system during testing.

On Distributed platforms, MaxChannels is an attribute in the qm.ini file.
The value for MaxChannels must be in the range 1 through 65535, with a default value of 100.

Example on how to change the maximum channels for a queue manager from the default 100 to 300:

Step 1: Modify the qm.ini of the queue manager:
CHANNELS:
   MaxChannels=300

Step 2: Stop and restart the queue manager for the change in the qm.ini to take effect.

 

+++ Related articles

a) For UNIX: One possible way to apply this information is to create a cron job that issues the mentioned command and if the number of running channels is getting closer to the MaxChannels, then an MQ Administrator might be notified. The following technote could be used as a reference for creating a cron job:
  Cron job for clearing all messages from a queue
  http://www-01.ibm.com/support/docview.wss?uid=swg21249309

b) Tutorial: How to identify MQ client connections and stop them
http://www.ibm.com/support/docview.wss?uid=swg27045669

 

 

 


Cross reference information
Product Component Platform Version Edition
IBM MQ

Product Alias/Synonym

WebSphere MQ WMQ

Document information

More support for: WebSphere MQ

Component: Channels LU62 / TCP

Software version: 6.0, 7.0, 7.1, 7.5, 8.0, 9.0, 9.1

Operating system(s): AIX, HP-UX, IBM i, Linux, Solaris, Windows

Reference #: 1449463

Modified date: 14 December 2018