IBM Support

Setting the TCP/IP KeepAlive interval to be used by WebSphere MQ

Question & Answer


Question

The method of setting the keep alive interval is different on each platform. What is the method for the most commonly used platforms?

Cause

You are seeing problems with hung channels. For example, the queue manager has "orphaned" instances of SVRCONN channels where the client has lost its connection. Or, a sender or receiver channel is in a RUNNING state even though the other end of the channel is no longer available.


Error messages such as the following may be observed in the queue manager logs:

Distributed platforms:

    AMQ9489  The maximum number of instances, <insert_1>, of channel <insert_3> was reached
    AMQ9490  The maximum number of instances, <insert_1>, of channel <insert_3> was reached for an individual client.
    AMQ9513  Maximum number of channels reached.
    AMQ9573  Maximum number of active channels reached.

z/OS:
    CSQX489E Maximum instance limit limit exceeded, channel channel-name connection conn-id 
    CSQX490E Maximum client instance limit limit exceeded, channel channel-name connection conn-id
    CSQX513E Current channel limit exceeded, channel channel-name connection conn-id 
    CSQX573E Channel channel-name exceeded active channel limit

Answer

  • Register the queue manager's interest in using the Keep Alive function


  • NOTE: For a client channel, keepalive also has to be implemented by the client. It is NOT sufficient to just have KEEPALIVE on at the system level. See additional information under the "Clients" heading below.

      - AIX, HP, Linux, and Solaris:
      add KeepAlive=YES to the TCP stanza in /var/mqm/qm.ini:
          TCP:
          KeepAlive=Yes

      - Windows:
      use the WebSphere MQ Explorer to enable KeepAlive as described in Enabling TCP/IP KeepAlive on Windows.

      To enable keepalive for a client, you need to define the following registry key:
      HKLM\SOFTWARE\IBM\MQSeries\CurrentVersion\Configuration\TCP
      and define a string value of 'KeepAlive' set to 'Yes'

      This is the Windows equivalent of the /var/mqm/qm.ini file.
      The parameter takes effect immediately, and is a permanent change

      - i5/OS (iSeries):
      Add the following entry to your queue manager configuration file (qm.ini in the IFS directory, /QIBM/UserData/mqm/qmgrs/queue manager name):

      TCP:
      KeepAlive=yes

      - z/OS:
      issue the WebSphere MQ command:

        /cpf ALTER QMGR TCPKEEP(YES)

      where 'cpf' is the command prefix for the queue manager subsystem.


      - Clients:
      V6 clients use the qm.ini file or Windows registry. V7 and higher clients, including those on the Windows platform, use the mqclient.ini file. For connections to z/OS queue managers, see KAINT(keepalive) for an orphaned client channel in WebSphere MQ for z/OS for more details.

      The WebSphere MQ V6 classes for Java and classes for JMS do not enable KeepAlive from the client side. They do not access the qm.ini file. However, the V7 and above Java/JMS classes will pick up the value of the:
      TCP:
      KeepAlive=
      stanza in the mqclient.ini file. Reference the Java client connections topic. The default value for KeepAlive that is used by the V7 Java/JMS classes is NO, which means that it must be explicitly turned on in the mqclient.ini file.

  • You can set the keepalive interval at a system-wide level:

    • AIX:
      to query the value:
        no -a tcp_keepintvl
        no -a tcp_keepidle

      to set the value:
        no -o tcp_keepintvl=20
        no -o tcp_keepidle=120

      The interval is in half-seconds. The parameter takes effect immediately. If the machine is rebooted the parameter is reset to the default value. To make the change permanent, add the 'no' commands to the /etc/rc.net script.

      HP-UX:

      to query the value:
      ndd -get /dev/tcp tcp_keepalive_interval

      to set the value:
      ndd -set /dev/tcp tcp_keepalive_interval <newValue>

      The interval is in milliseconds. The parameter takes effect immediately. If the machine is rebooted the parameter is reset to the default value. To make the change permanent, add the 'ndd' command to the /etc/rc.config.d/nddconf file.

      The 'ndd' command in HP-UX 11.x replaced the 'nettune' command.

      i5/OS:
      Use CFGTCP option 3 (or CHGTCPA TCPKEEPALV(xxx)) to specify a time interval in minutes. You can specify a value in the range 1 through 40320 minutes; the default is 120.

      Linux:
      To set the value:
        write the number of seconds into: /proc/sys/net/ipv4/tcp_keepalive_time


      Solaris:
      to query the value:
      ndd -get /dev/tcp tcp_keepalive_interval

      to set the value:
      ndd -set /dev/tcp tcp_keepalive_interval 60000

      The interval is in milliseconds. The parameter takes effect immediately. If the machine is rebooted the parameter is reset to the default value. To make the change permanent, add the 'ndd' command to the /etc/init.d/inetinit script.

      Windows:

      Carefully modify the registry as described in Enabling TCP/IP KeepAlive on Windows.


      z/OS:
      Update your TCP/IP PROFILE data set and add or change the INTERVAL parameter in the TCPCONFIG section. The default is 2 hours.

  • You can set a per-channel keepalive interval to override the system default:

    • - For non-z/OS platforms, use the Heartbeat interval (HBINT). The default 300 seconds.

      IC98704 describes a problem with MQ 7.1 and 7.5 client application connections not ending after the heartbeat timeout period.

      - For z/OS, use KeepAlive Interval (KAINT). The product documentation says:
      "If AUTO is specified for KAINT, and it is a server-connection channel, the TCP INTERVAL value is used instead for the keepalive interval.

      In this case, KAINT is zero in DISPLAY CHSTATUS; it would be non-zero if an integer had been coded instead of AUTO."

      The default is AUTO. If you want to use a value different from the TCP/IP INTERVAL, you will need to set KAINT to an integer, which should be greater than HBINT.

[{"Product":{"code":"SSFKSJ","label":"WebSphere MQ"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Channels LU62 \/ TCP","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF012","label":"IBM i"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"},{"code":"PF035","label":"z\/OS"}],"Version":"9.0;8.0;7.5;7.1;7.0.1;7.0","Edition":"","Line of Business":{"code":"LOB36","label":"IBM Automation"}}]

Product Synonym

WMQ MQ

Document Information

Modified date:
15 June 2018

UID

swg21216834