IBM Support

Details regarding ClntSndBuffSize, ClntRcvBuffSize and Connect_Timeout

Question & Answer


Question

What are the new WebSphere MQ V7 Client configuration file parameters (ClntSndBuffSize, ClntRcvBuffSize and Connect_Timeout ) used for?

Answer

The WebSphere MQ V7 Client configuration file contains new settings in the TCP stanza. The following includes details regarding the Client configuration file, TCP stanza, and the new parameters added in V7: ClntSndBuffSize, ClntRcvBuffSize and Connect_Timeout.






Client configuration file (mqclient.ini)

Configure your WebSphere MQ clients using a text file, similar to the queue manager configuration file, qm.ini, used on UNIX platforms. The file contains a number of stanzas, each of which contains a number of lines of the format attribute-name=value. The file name is mqclient.ini.

The configuration features apply to all connections a client application makes to any queue managers, rather than being specific to an individual connection to a queue manager.

Consult the product documentation for the location of this file: Location of the client configuration file


TCP stanza of the client configuration file
Use the TCP stanza to specify TCP network protocol configuration parameters.

The following attributes can be included in the TCP stanza:


    ClntRcvBuffSize=number|32768
    The size in bytes of the TCP/IP receive buffer used by the client end of a client-connection server-connection channel.

    ClntSndBuffSize=number|32768
    The size in bytes of the TCP/IP send buffer used by the client end of a client-connection server-connection channel.

    Connect_Timeout=number
    The number of seconds before an attempt to connect the socket will time out; the default is 0 unless the channel has been configured with a non-zero client channel weighting in which case the default is 5.

    IPAddressVersion=MQIPADDR_IPV4|MQIPADDR_IPV6
    Specifies which IP protocol to use for a channel connection.

    It has the possible string values of MQIPADDR_IPV4 or MQIPADDR_IPV6. These values have the same meanings as IPV4 and IPV6, respectively, in ALTER QMGR IPADDRV.

    KeepAlive=YES|NO


    Switch the KeepAlive function on or off. KeepAlive=YES causes TCP/IP to check periodically that the other end of the connection is still available. If it is not, the channel is closed.

    Library1=DLLName|WSOCK32
    (Windows only) The name of the TCP/IP sockets DLL.



Details regarding ClntSndBuffSize, ClntRcvBuffSize and Connect_Timeout

ClntSndBuffSize: The size in bytes of the TCP/IP send buffer for each channel instance.


ClntRcvBuffSize: The size in bytes of the TCP/IP receive buffer for each channel instance.

Setting these values in qm.ini file causes the queue manager (MCA processes) to set the TCP attributes of the sockets used for communication, by making a call to setsockopt(). These specify the sizes of the TCP send and receive buffers respectively. The specified value is used if it is greater than the default value of 32K bytes (32768 bytes). Buffer sizes may be increased for high-volume connections.

The default value of 32768 bytes is good enough for most of the situations. Because, when message segmentation is enabled, large MQ messages will be split into segments of 32K bytes. Messages are sent using send() (or write()) calls. When message segmentation is not specified, messages larger than 32K bytes will be internally split by TCP into multiple chunks for transmission. Having a larger send/receiver buffer size reduces the number of such message chunks, resulting in a better throughput in the TCP/IP transfer. Customers have to set this value to an optimal value based on the size of their application messages.

Connect_Timeout: The number of seconds before an attempt to connect the socket times out. The default value of zero specifies that there is no connect timeout.

MQ channel processes connect over non-blocking sockets. Therefore, if the other end of the socket is not ready, connect() returns immediately with EINPROGRESS or EWOULDBLOCK. Following this, connect will be attempted again (a total of 20 such attempts before communications error is reported).

If Connect_Timeout is set to a non-zero value, MQ waits for the stipulated period over select() call for the socket to get ready. This increases the chances of success of subsequent connect() call. This option may be beneficial in situations where connects would require some waiting period due to high load on the network.

Notes:

- There is no relation between the "Connect_Timeout" and ClntSndBuffSize / ClntRcvBuffSize parameters.
- Connect_Timeout is available only on WMQ v7. In v6, connect() happens over non-blocking sockets, where connect is attempted twenty times (with a wait of 50 seconds).
- In MQ v6, MQ sets the send and receive buffers to the default 32K
- ClntSndBuffSize or ClntRcvBuffSize are not limited by tcp_max_buf or tcp_xmit_hiwat or tcp_recv_hiwat.




Example client configuration file (mqclient.ini)

#* Module Name: mqclient.ini                                       *#
#* Type       : WebSphere MQ client configuration file             *#
#  Function   : Define the configuration of a client               *#
#*                                                                 *#
#*******************************************************************#
#* Notes      :                                                    *#
#* 1) This file defines the configuration of a client              *#
#*                                                                 *#
#*******************************************************************#

ClientExitPath:
  ExitsDefaultPath=/var/mqm/exits
  ExitsDefaultPath64=/var/mqm/exits64

TCP:
  Library1=DLLName1
  KeepAlive = Yes
 
ClntSndBuffSize=32768
  ClntRcvBuffSize=32768
  Connect_Timeout=0


MessageBuffer:
  MaximumSize=-1
  Updatepercentage=-1
  PurgeTime=0

LU62:
  TPName
  Library1=DLLName1
  Library2=DLLName2



References
This section provides you with information that can help you learn more about this topic.

[{"Product":{"code":"SSFKSJ","label":"WebSphere MQ"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Clients","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"8.0;7.5;7.1;7.0","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Product Synonym

WMQ MQ

Document Information

Modified date:
23 June 2018

UID

swg21408485