WebSphere MQ

Debugging Queue Manager Issues

We might need to troubleshoot production issues and determine how many messages arrived a queue, when it arrived, when it was revived by a listener or how much time the overall transaction took. We can enable accounting and statistics in queues and channels to find the specifics and go deeper to look into the problem.

The Accounting and Statistics parameter exists both the queue manager level and the respective queues/channels level. We need to enable on the queue manager as well as on the channel/queue level. Below are few useful information on the same:

alter qmgr ACCTMQI(ON) ACCTQ(ON) STATQ(ON) STATMQI(ON) STATCHL(HIGH)

You can change the STATINT ACCTINT as well which determines at which interval the statistics are passed to the respective queues.

Here are the two queues where you get the required information after profiling for sometime:

SYSTEM.ADMIN.STATISTICS.QUEUE

SYSTEM.ADMIN.ACCOUNTING.QUEUE

Once profiling is done, you can go ahead and read out the statistics using amqsmon utility:

$ ./amqsmon
You must select either the accounting or statistics queue
Usage: ./amqsmon [-m QMgrName]
[-t statistics] # Process statistics queue
[-a] # Show only QMGR statistics
[-q [queue_name]] # Show only Queue statistics
[-c [channel_name]] # Show only Channel statistics
[-t accounting] # Process accounting queue
[-a] # Process only MQI accounting
[-q] [queue_name]] # Process only Queue accounting
[-i <connectionId>] # Process only matching connection
[-b] # Only browse records
[-d <depth>] # Number of records to display
[-w <timeout>] # Time to wait (in seconds)
[-l <fieldlist,…>] # Display only these fields
[-s <startTime>] # Start time of record to process
[-e <endTime>] # End time of record to process

amqsmon -m qmgr1 -t statistics

Below is the sample stats from which the important points are put in bold:

MonitoringType: QueueStatistics
QueueManager: ‘qmgr1’
IntervalStartDate: ‘2018-05-07’
IntervalStartTime: ‘05.58.17’
IntervalEndDate: ‘2018-05-07’
IntervalEndTime: ‘05.58.47’
CommandLevel: 800
ObjectCount: 1
QueueStatistics: 0
QueueName: ‘MYXMITQ’
CreateDate: ‘2018-05-06’
CreateTime: ‘15.50.42’
QueueType: Local
QueueDefinitionType: Predefined
QMinDepth: 0
QMaxDepth: 10
AverageQueueTime: [0, 0]
PutCount: [10, 0]
PutFailCount: 0
Put1Count: [0, 0]
Put1FailCount: 0
PutBytes: [4291, 0]
GetCount: [0, 0]
GetBytes: [0, 0]
GetFailCount: 0
BrowseCount: [0, 0]
BrowseBytes: [0, 0]
BrowseFailCount: 0
NonQueuedMsgCount: 0
ExpiredMsgCount: 0
PurgeCount: 0

 

amqsmon -m qmgr1 -t accounting

MonitoringType: QueueAccounting
QueueManager: ‘qmgr1’
IntervalStartDate: ‘2018-05-07’
IntervalStartTime: ‘05.58.38’
IntervalEndDate: ‘2018-05-07’
IntervalEndTime: ‘05.58.46’
CommandLevel: 800
ConnectionId: x’414d5143716d677231202020202020207db2ee5a013b0020′
SeqNumber: 0
ApplicationName: ‘amqsput’
ApplicationPid: 23190
ApplicationTid: 1
UserId: ‘mqm’
ObjectCount: 1
QueueAccounting: 0
QueueName: ‘MYXMITQ’
CreateDate: ‘2018-05-06’
CreateTime: ‘15.50.42’
QueueType: Local
QueueDefinitionType: Predefined
OpenCount: 1
OpenDate: ‘2018-05-07’
OpenTime: ‘05.58.38’
CloseCount: 1
CloseDate: ‘2018-05-07’
CloseTime: ‘05.58.46’
PutCount: [10, 0]
PutFailCount: 0
Put1Count: [0, 0]
Put1FailCount: 0
PutBytes: [11, 0]
PutMinBytes: [1, 0]
PutMaxBytes: [2, 0]
GetCount: [0, 0]
GetFailCount: 0
GetBytes: [0, 0]
GetMinBytes: [0, 0]
GetMaxBytes: [0, 0]
BrowseCount: [0, 0]
BrowseFailCount: 0
BrowseBytes: [0, 0]
BrowseMinBytes: [0, 0]
BrowseMaxBytes: [0, 0]
GeneratedMsgCount: 0

 

MonitoringType: QueueAccounting
QueueManager: ‘qmgr1’
IntervalStartDate: ‘2018-05-07’
IntervalStartTime: ‘05.54.06’
IntervalEndDate: ‘2018-05-07’
IntervalEndTime: ‘05.54.31’
CommandLevel: 800
ConnectionId: x’414d5143716d677231202020202020207db2ee5a03360020′
SeqNumber: 0
ApplicationName: ‘amqsget’
ApplicationPid: 19951
ApplicationTid: 1
UserId: ‘mqm’
ObjectCount: 1
QueueAccounting: 0
QueueName: ‘MYXMITQ’
CreateDate: ‘2018-05-06’
CreateTime: ‘15.50.42’
QueueType: Local
QueueDefinitionType: Predefined
OpenCount: 1
OpenDate: ‘2018-05-07’
OpenTime: ‘05.54.06’
CloseCount: 1
CloseDate: ‘2018-05-07’
CloseTime: ‘05.54.31’
PutCount: [0, 0]
PutFailCount: 0
Put1Count: [0, 0]
Put1FailCount: 0
PutBytes: [0, 0]
PutMinBytes: [0, 0]
PutMaxBytes: [0, 0]
GetCount: [80, 0]
GetFailCount: 1
GetBytes: [34396, 0]
GetMinBytes: [429, 0]
GetMaxBytes: [493, 0]
BrowseCount: [0, 0]
BrowseFailCount: 0
BrowseBytes: [0, 0]
BrowseMinBytes: [0, 0]
BrowseMaxBytes: [0, 0]
GeneratedMsgCount: 0
TimeOnQMin: [153809670, 0]
TimeOnQMax: [15416123277, 0]
TimeOnQAvg: [11581116004, 0]

 

  • You can use the below command to dump the statistics/accounting information in case you cannot wait till the STATINT

RESET QMGR TYPE(STATISTICS)

Leave a Reply

Your email address will not be published. Required fields are marked *