Troubleshooting Message Queue messages get delayed intermittently

 

Symptom:

Sometime you may find the MQ messages get delayed intermittently. The delays are about 60 seconds which cause loss of business opportunity.

 

Troubleshooting:

The MQ journal log on the target MQ server shows a delay between the send and arrive time of the delayed messages.

 

The performance count “MSMQ Service\MSMQ Incoming Messages” on the target MQ server shows the incoming message number is increased after a delay to the send time.

 

The network monitor tells below details,

1. The connection between sender and target MQ server is reset or closed before the delayed messages are sent out.

2. The connection is restored after 60 seconds. During the silent time no message can be sent out.

3. The messages are sent out as soon as the connection is restored.

It is common for MQ service to close the connection. For example when connection has been idle for some time or the network is not healthy and needs to be restored.

After closing the connection, MQ is designed to have a delay before restoring the connection. No message can be sent out during this time period and will be delayed.

This behavior is described in https://support.microsoft.com/kb/909401, since Windows 2003 SP1, the delay has been increased from 4 seconds to 60 seconds.

Solution:

Follow the solution in above KB and modify registry key WaitTime under below path to a shorter value.

HKEY_LOCAL_MACHINE\Software\Microsoft\MSMQ\Parameters

Regards,

Juntao