WebSphere MQ 连接调优
WebSphere MQ Connection Tuning
我有一个应用程序,它使用 MDB、激活规范和队列连接工厂来 get/put 来自 WMQ 的消息。该应用程序期望最大负载为 80 tps。 Websphere Application Server 和 WMQ 都是集群的,每个应用程序服务器连接到单独的主机和通道。应用程序 onMessage 方法的实现方式是在使用消息并发送响应后关闭会话和连接。
根据我们的配置,我们的 WAS 版本为 8.5,IBM MQ 队列管理器版本为 7,每个节点的 act 规范的最大服务器会话数设置为 40。连接工厂中每个节点的最大连接计数为 40,连接工厂会话池中的最大会话为 10。
现在在峰值负载下,我们希望创建最多 80 个 MQ 通道实例,但根据调查,我们可以看到它超过 200,这会在达到最大实例限制时导致问题。
这是因为连接工厂的会话池中的最大会话设置为 10 造成的吗?
有没有可能即使我们在onMessage中关闭会话和连接,一个连接仍然可以有多个会话。如果是这样,将此 属性 设置为 1 是否明智?
也可以在 WMQ 设置一些 属性,这可能会导致 MQ 通道实例增加。
您没有提到 WAS 或 MQ 的特定版本,并且特定版本可能存在已知问题,这些问题会改变行为,但通常它应该如下所述工作。
IBM 有一篇很好的技术说明“TCP/IP Connection usage between WebSphere Application Server V7 and V8, and WebSphere MQ V7 (and later) explained”,其中详细介绍了这个主题。
您没有提到您将 SVRCONN 通道的 SHARECNV
设置为什么,如下所示,这将影响观察到的通道实例的数量,我假设计算的默认值为 10。
请注意,下面的块引用来自技术说明
- 我们已将行为规范的 最大服务器会话 设置为
40
每个节点
上面的 link 指出:
Maximum number of conversations = Maximum server sessions + 1
最大对话数 = 40 + 1
= 41
link 还指出:
Maximum number of TCP/IP channel instances = Maximum number of conversations / SHARECNV for the channel being used
TCP/IP通道实例的最大数量=41 / 10
=5
(四舍五入到最近的连接)
- 连接工厂中的最大连接数到每个节点
40
- 连接工厂的会话池中的最大会话到
10
。
Maximum number of conversations = Connection Pool Maximum Connections + (Connection Pool Maximum Connections * Session Pool Maximum Connections)
最大对话数 = 40 + (40 * 10)
= 440
Maximum number of TCP/IP channel instances = Maximum number of conversations / SHARECNV
for the channel being used
TCP/IP 个通道实例的最大数量 = 440 / 10
= 44
如果您的 MQ SVRCONN 通道的 SHARECNV
设置为 10
,那么基于连接到单独通道的每个节点,每个通道的通道实例不应超过 49 个。
如果您正在访问 200 个通道实例,我会怀疑您的 SHARECNV
小于 10。如果它是 1,则 WAS 尝试创建的通道实例的最大数量将达到 481
这将受到频道 MAXINST
到 200
.
的限制
After an application has finished with a JMS Connection and closed it off, it is moved from the Active Pool to the Free Pool, where it is available for reuse. The Connection Pool property Unused timeout defines how long a JMS Connection will stay in the Free Pool before it is disconnected. This property has the default value of 1800 seconds, which is 30 minutes.
Every JMS Connection that is created from a WebSphere MQ messaging provider Connection Factory has an associated JMS Session Pool, which work in the same way as Connection Pools. The maximum number of JMS Sessions that can be created from a single JMS Connection is determined by the Connection Factory Session Pool property Maximum connections. The default value of this property is 10.
A conversation is started when a JMS Session is first created, and will remain active until the JMS Session is closed because it has remained in the Free Pool for longer than the value of the Session Pool's Unused timeout property.
当您的应用在 onMessage 中关闭会话和连接时,连接被移至空闲池以供重用,会话被移至空闲池以供重用,MQ Channel 实例将不会关闭,直到相应的超时被击中。
如果您想将最大通道数保持在 200 以下,则可以将 会话池最大连接数) 调整为 1,这与您的激活规范和 SHARECNV(1 ) 最多可使用 121 个通道实例。
您还可以增加通道的 SHARECNV 值,这将导致通道实例除以该数字。
可能是您的连接或会话没有正确关闭,您有一个“泄漏”。
我有一个应用程序,它使用 MDB、激活规范和队列连接工厂来 get/put 来自 WMQ 的消息。该应用程序期望最大负载为 80 tps。 Websphere Application Server 和 WMQ 都是集群的,每个应用程序服务器连接到单独的主机和通道。应用程序 onMessage 方法的实现方式是在使用消息并发送响应后关闭会话和连接。
根据我们的配置,我们的 WAS 版本为 8.5,IBM MQ 队列管理器版本为 7,每个节点的 act 规范的最大服务器会话数设置为 40。连接工厂中每个节点的最大连接计数为 40,连接工厂会话池中的最大会话为 10。 现在在峰值负载下,我们希望创建最多 80 个 MQ 通道实例,但根据调查,我们可以看到它超过 200,这会在达到最大实例限制时导致问题。
这是因为连接工厂的会话池中的最大会话设置为 10 造成的吗?
有没有可能即使我们在onMessage中关闭会话和连接,一个连接仍然可以有多个会话。如果是这样,将此 属性 设置为 1 是否明智? 也可以在 WMQ 设置一些 属性,这可能会导致 MQ 通道实例增加。
您没有提到 WAS 或 MQ 的特定版本,并且特定版本可能存在已知问题,这些问题会改变行为,但通常它应该如下所述工作。
IBM 有一篇很好的技术说明“TCP/IP Connection usage between WebSphere Application Server V7 and V8, and WebSphere MQ V7 (and later) explained”,其中详细介绍了这个主题。
您没有提到您将 SVRCONN 通道的 SHARECNV
设置为什么,如下所示,这将影响观察到的通道实例的数量,我假设计算的默认值为 10。
请注意,下面的块引用来自技术说明
- 我们已将行为规范的 最大服务器会话 设置为
40
每个节点
上面的 link 指出:
Maximum number of conversations = Maximum server sessions + 1
最大对话数 = 40 + 1
= 41
link 还指出:
Maximum number of TCP/IP channel instances = Maximum number of conversations / SHARECNV for the channel being used
TCP/IP通道实例的最大数量=41 / 10
=5
(四舍五入到最近的连接)
- 连接工厂中的最大连接数到每个节点
40
- 连接工厂的会话池中的最大会话到
10
。
Maximum number of conversations = Connection Pool Maximum Connections + (Connection Pool Maximum Connections * Session Pool Maximum Connections)
最大对话数 = 40 + (40 * 10)
= 440
Maximum number of TCP/IP channel instances = Maximum number of conversations /
SHARECNV
for the channel being used
TCP/IP 个通道实例的最大数量 = 440 / 10
= 44
如果您的 MQ SVRCONN 通道的 SHARECNV
设置为 10
,那么基于连接到单独通道的每个节点,每个通道的通道实例不应超过 49 个。
如果您正在访问 200 个通道实例,我会怀疑您的 SHARECNV
小于 10。如果它是 1,则 WAS 尝试创建的通道实例的最大数量将达到 481
这将受到频道 MAXINST
到 200
.
After an application has finished with a JMS Connection and closed it off, it is moved from the Active Pool to the Free Pool, where it is available for reuse. The Connection Pool property Unused timeout defines how long a JMS Connection will stay in the Free Pool before it is disconnected. This property has the default value of 1800 seconds, which is 30 minutes.
Every JMS Connection that is created from a WebSphere MQ messaging provider Connection Factory has an associated JMS Session Pool, which work in the same way as Connection Pools. The maximum number of JMS Sessions that can be created from a single JMS Connection is determined by the Connection Factory Session Pool property Maximum connections. The default value of this property is 10.
A conversation is started when a JMS Session is first created, and will remain active until the JMS Session is closed because it has remained in the Free Pool for longer than the value of the Session Pool's Unused timeout property.
当您的应用在 onMessage 中关闭会话和连接时,连接被移至空闲池以供重用,会话被移至空闲池以供重用,MQ Channel 实例将不会关闭,直到相应的超时被击中。
如果您想将最大通道数保持在 200 以下,则可以将 会话池最大连接数) 调整为 1,这与您的激活规范和 SHARECNV(1 ) 最多可使用 121 个通道实例。
您还可以增加通道的 SHARECNV 值,这将导致通道实例除以该数字。
可能是您的连接或会话没有正确关闭,您有一个“泄漏”。