- 浏览: 307175 次
- 性别:
- 来自: 杭州
文章分类
最新评论
-
wst0350:
点赞,有空深入讲解下原理
Servlet、Filter 和 Listener 调用顺序、生命周期的实验分析 -
tuspark:
Eclipse中高亮设置内容还有很多细节选项可以设置的,可以看 ...
Eclipse 设置匹配代码高亮 -
xichao1929:
这个时候,怎么启动发布的项目呢?????
JBoss设置为Windows服务 -
xiaozi7:
非常感谢,楼主的英语水平不一般那
WebSphere MQ Version 7 发布订阅相关配置 -
qtlkw:
slave没玩过
Hudson: java.lang.OutOfMemoryError: Java heap space error
JMS connection pools and sessions pools in WebSphere Application Server
- 博客分类:
- JAVA
转载: http://www-01.ibm.com/support/docview.wss?uid=swg21168924
Question
Frequently Asked Questions concerning connection pools and sessions pools in IBM® WebSphere® Application Server.
Answer
Q: WebSphere MQ Queue Connection Factories in WebSphere Application Server releases contain both a connection pool and a session pool for configuration. When configuring the session pool, is this configuration per each connection? For example, if my connection pool has a maximum size of 10, and my session pool also has a maximum size of 10, does that mean that I have a total of 10 sessions available per connection (which would make this 100 sessions for 10 connections) or does this mean that there are only 10 sessions available to be used among 10 connections?
A: The session pool setting applies to each JMS connection as this is the factory for sessions, so you can have a maximum of 10 sessions for each connection and a maximum of 10 connections. So, in total, this mean you might have 100 channels (connections) open to the MQ Server.
Q: What happens if my session pool has a maximum of 10 session and connections and I attempt to create a new session from a connection that exceeds this maximum session and connection? Does the pool grow? Is an exception thrown? If so, what kind of exception?
A: When the maximum number of connections and sessions is reached, and a request for a new connection or session is received, the pool manager waits for a period of time defined in the Connection timeout property for an available physical connection. If a connection is not available in the time period defined by the Connection timeout property, the Pool manager throws a ConnectionWaitTimeoutException. This is documented in more detail in the Connection timeout section on the Session pool settings page of the WebSphere Application Server Information Center.
Q: When closing a QueueConnection JMS in WebSphere Application Server with Connection Pooling configured, what exactly happens?
A: When a connection is closed, it is returned to the connection pool, and the session to its session pool. Any QueueSender and QueueReceiver objects associated with the session are destroyed.
Q: From a design perspective, is there a formula regarding the sizing of the WebSphere MQ JMS connection pool and JMS session pool with respect to the number of concurrent requests?
A: No formula exists. However, we recommend that you set the Max Connections property for your connection pool to a value about 50% higher than your typical JMS connection concurrency, and the Max Connections property for your session pool to approximately 50% more than the average number of concurrent sessions requested on a JMS Connection. The requirements really depend on the design of your application; in particular, how it uses JMS connections and sessions. You should also remember that the Max Connections property for your session pool is the maximum number of sessions that can be made from a single JMS Connection, because a JMS connection is a factory for sessions.
Q: How can I utilize a WebSphere MQ JMS session pool without having to manage the JMS connections in the application? It appears that if I have a JMS connection pool and a JMS session pool, I need to keep track of my connections in some collector object to use the number of sessions I have configured for use with each connection. How do you make use of those sessions in the session pool without having to maintain your own programmatic list of connections that are configured in the connection pool? For example, having retrieved a connection from the connection pool, what is the approach for creating sessions for multiple users without having to maintain that connection reference and a collector object in my application?
A: JMS connections are non-shareable. Therefore, unless your application does something like caching a connection in a static class variable (which is definitely not recommended in practice), an Enterprise JavaBeans™ method has only a single JMS connection/JMS session pair per EJB method thread. Currently, the JCA Connection Manager does not support sharing of non-transactional resources such as a JMS connection and so that must be handled in your application code. Note that, from a WebSphere MQ perspective, a JMS connection is very lightweight. It is the JMS session that is the heavyweight object. Also be aware that in the Sun J2EE™ 1.4 specification, an Application Server must enforce an application so that it can only create a single JMS session from a JMS connection. A possible reason behind the Sun decision to do this is because of Connection Management considerations, and the fact that in J2EE 1.4, JMS providers are advised to be defined as JCA Resource Adapters.
转载: http://www-01.ibm.com/support/docview.wss?uid=swg21201242
Problem(Abstract)
In WebSphere Application Server, all JMS connection factories, including queue connection factories (QCFs) and topic connection factories (TCFs) have connection pool and session pool settings that can be configured.
This technote explains the following points:
* The difference between these pools and their relationship
* The maximum number of TCP/IP connections to a WebSphere MQ queue manager that is expected with a given set of connection pool and session pool settings
* The manner in which these settings are affected when message listener ports are configured to use the connection factory
Resolving the problem
In the JMS programming model, an application must get a JMS connection and a JMS session to send a message. A typical JMS application that sends messages looks like this:
QueueConnectionFactory qcf = (QueueConnectionFactory)ctx.lookup("jms/qcf");
Queue queue = (Queue)ctx.lookup("jms/q");
QueueConnection jmsconn = qcf.createQueueConnection();
QueueSession session = jmsconn.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
QueueSender sender = session.createSender(queue);
TextMessage message = session.createTextMessage("Message Text");
sender.send(message);
The call to createQueueConnection gets a connection from the connection pool. The call to createQueueSession gets a session from the session pool.
By default, the Max Connections property for the connection pool and session pool is 10. This means that there can be a maximum of 10 connections or sessions in each pool. Each connection in the connection pool has its own session pool. This means that there can be 10 session pools that can have a maximum of 10 sessions each.
Each session represents a TCP/IP connection to the queue manager. With the settings mentioned here, there can be a maximum of 100 TCP/IP connections. If you are using WebSphere MQ, it is important to tune the queue manager's MaxChannels setting, located in the qm.ini file, to a value greater than the sum of the maximum possible number of sessions from each JMS connection factory that connects to the queue manager.
In addition to sending messages, the connection pools and session pools are used by the WebSphere Application Server message listener ports to receive messages and pass them to the message driven bean (MDB) associated with the listener port. When a listener port is defined, it is configured with a JMS connection factory. Each listener port uses one connection from the connection factory's connection pool.
There is also a setting on the listener port called Maximum sessions. The value of this property is the number of sessions that are used in the session pool of the connection that is used by the listener port. This influences the number of messages that can be concurrently processed by the listener port. The number of listener ports configured to use a connection factory, as well as the Maximum sessions settings on the listener ports, should be taken into consideration when tuning the connection pool and session pool settings.
Note: If the Maximum sessions for a listener port is greater than the Max Connections setting for the session pool, the Maximum sessions is changed to the value of Max Connections when the listener port starts.
Question
Frequently Asked Questions concerning connection pools and sessions pools in IBM® WebSphere® Application Server.
Answer
Q: WebSphere MQ Queue Connection Factories in WebSphere Application Server releases contain both a connection pool and a session pool for configuration. When configuring the session pool, is this configuration per each connection? For example, if my connection pool has a maximum size of 10, and my session pool also has a maximum size of 10, does that mean that I have a total of 10 sessions available per connection (which would make this 100 sessions for 10 connections) or does this mean that there are only 10 sessions available to be used among 10 connections?
A: The session pool setting applies to each JMS connection as this is the factory for sessions, so you can have a maximum of 10 sessions for each connection and a maximum of 10 connections. So, in total, this mean you might have 100 channels (connections) open to the MQ Server.
Q: What happens if my session pool has a maximum of 10 session and connections and I attempt to create a new session from a connection that exceeds this maximum session and connection? Does the pool grow? Is an exception thrown? If so, what kind of exception?
A: When the maximum number of connections and sessions is reached, and a request for a new connection or session is received, the pool manager waits for a period of time defined in the Connection timeout property for an available physical connection. If a connection is not available in the time period defined by the Connection timeout property, the Pool manager throws a ConnectionWaitTimeoutException. This is documented in more detail in the Connection timeout section on the Session pool settings page of the WebSphere Application Server Information Center.
Q: When closing a QueueConnection JMS in WebSphere Application Server with Connection Pooling configured, what exactly happens?
A: When a connection is closed, it is returned to the connection pool, and the session to its session pool. Any QueueSender and QueueReceiver objects associated with the session are destroyed.
Q: From a design perspective, is there a formula regarding the sizing of the WebSphere MQ JMS connection pool and JMS session pool with respect to the number of concurrent requests?
A: No formula exists. However, we recommend that you set the Max Connections property for your connection pool to a value about 50% higher than your typical JMS connection concurrency, and the Max Connections property for your session pool to approximately 50% more than the average number of concurrent sessions requested on a JMS Connection. The requirements really depend on the design of your application; in particular, how it uses JMS connections and sessions. You should also remember that the Max Connections property for your session pool is the maximum number of sessions that can be made from a single JMS Connection, because a JMS connection is a factory for sessions.
Q: How can I utilize a WebSphere MQ JMS session pool without having to manage the JMS connections in the application? It appears that if I have a JMS connection pool and a JMS session pool, I need to keep track of my connections in some collector object to use the number of sessions I have configured for use with each connection. How do you make use of those sessions in the session pool without having to maintain your own programmatic list of connections that are configured in the connection pool? For example, having retrieved a connection from the connection pool, what is the approach for creating sessions for multiple users without having to maintain that connection reference and a collector object in my application?
A: JMS connections are non-shareable. Therefore, unless your application does something like caching a connection in a static class variable (which is definitely not recommended in practice), an Enterprise JavaBeans™ method has only a single JMS connection/JMS session pair per EJB method thread. Currently, the JCA Connection Manager does not support sharing of non-transactional resources such as a JMS connection and so that must be handled in your application code. Note that, from a WebSphere MQ perspective, a JMS connection is very lightweight. It is the JMS session that is the heavyweight object. Also be aware that in the Sun J2EE™ 1.4 specification, an Application Server must enforce an application so that it can only create a single JMS session from a JMS connection. A possible reason behind the Sun decision to do this is because of Connection Management considerations, and the fact that in J2EE 1.4, JMS providers are advised to be defined as JCA Resource Adapters.
转载: http://www-01.ibm.com/support/docview.wss?uid=swg21201242
Problem(Abstract)
In WebSphere Application Server, all JMS connection factories, including queue connection factories (QCFs) and topic connection factories (TCFs) have connection pool and session pool settings that can be configured.
This technote explains the following points:
* The difference between these pools and their relationship
* The maximum number of TCP/IP connections to a WebSphere MQ queue manager that is expected with a given set of connection pool and session pool settings
* The manner in which these settings are affected when message listener ports are configured to use the connection factory
Resolving the problem
In the JMS programming model, an application must get a JMS connection and a JMS session to send a message. A typical JMS application that sends messages looks like this:
QueueConnectionFactory qcf = (QueueConnectionFactory)ctx.lookup("jms/qcf");
Queue queue = (Queue)ctx.lookup("jms/q");
QueueConnection jmsconn = qcf.createQueueConnection();
QueueSession session = jmsconn.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
QueueSender sender = session.createSender(queue);
TextMessage message = session.createTextMessage("Message Text");
sender.send(message);
The call to createQueueConnection gets a connection from the connection pool. The call to createQueueSession gets a session from the session pool.
By default, the Max Connections property for the connection pool and session pool is 10. This means that there can be a maximum of 10 connections or sessions in each pool. Each connection in the connection pool has its own session pool. This means that there can be 10 session pools that can have a maximum of 10 sessions each.
Each session represents a TCP/IP connection to the queue manager. With the settings mentioned here, there can be a maximum of 100 TCP/IP connections. If you are using WebSphere MQ, it is important to tune the queue manager's MaxChannels setting, located in the qm.ini file, to a value greater than the sum of the maximum possible number of sessions from each JMS connection factory that connects to the queue manager.
In addition to sending messages, the connection pools and session pools are used by the WebSphere Application Server message listener ports to receive messages and pass them to the message driven bean (MDB) associated with the listener port. When a listener port is defined, it is configured with a JMS connection factory. Each listener port uses one connection from the connection factory's connection pool.
There is also a setting on the listener port called Maximum sessions. The value of this property is the number of sessions that are used in the session pool of the connection that is used by the listener port. This influences the number of messages that can be concurrently processed by the listener port. The number of listener ports configured to use a connection factory, as well as the Maximum sessions settings on the listener ports, should be taken into consideration when tuning the connection pool and session pool settings.
Note: If the Maximum sessions for a listener port is greater than the Max Connections setting for the session pool, the Maximum sessions is changed to the value of Max Connections when the listener port starts.
发表评论
-
es使用两种方式
2018-06-28 16:26 0第一种方式: 使用TransportClient packag ... -
hbase
2018-06-25 13:50 0package cn.com.duiba.appordersy ... -
guava
2017-09-22 18:03 6381.Guava Cache的get/getIfPresent方 ... -
转:架构
2017-06-23 08:13 493架构是软件的核心和灵魂,没有好的架构的软件经过一段时间的迭代后 ... -
使用 redis 减少 秒杀库存 超卖思路
2017-06-22 23:58 561612月份重构公司社群活动产品,原来自己不是很成熟,按传统的形式 ... -
经典笔试题
2017-06-21 23:30 495public class BaseTest { pu ... -
Restful vs RPC
2017-01-23 10:54 865传统的RPC一般是基于二 ... -
自动产生随机数
2016-11-11 10:54 555/** * java生成随机数字和字母组合 ... -
commons-lang常用工具类StringEscapeUtils
2016-11-10 20:12 8831.escapeSql 提供sql转移功能,防止sql注入攻击 ... -
Java8:Lambda表达式增强版Comparator和排序
2016-10-27 10:32 2693http://www.importnew.com/15259. ... -
Java序列化几点注意事项
2016-10-26 17:02 894静态变量不属于对象,属于类,不能被序列化.还有瞬态的变量也不能 ... -
Rest vs dubbo
2016-09-15 18:10 0Rest 基于http, 大数据量和安全性可能不佳 dubbo ... -
List删除element两种方式的不同
2016-07-26 12:41 679public class DateUtilTest { ... -
Xmemcached——比spymemcached更快
2016-07-18 10:23 467Xmemcached是一个高性能的 ... -
velocity 缓存设置
2016-07-04 20:54 1062#velocity 是否开启缓存 velocity.resou ... -
Java8 Stream用法
2016-07-04 18:58 01. collect(toList()) 由stream里的值 ... -
熔断器设计模式
2016-05-22 23:14 599转载: http://www.cnblogs.com/ ... -
Date 参数
2016-04-22 21:44 563Oracle TO_CHAR parameters: The ... -
Dubbo安装部署
2016-04-18 01:16 1609Jdk-1.6.30以上版本 Tomcat-7 ... -
java read也需要加锁
2016-02-27 18:11 643今天被问到read需不需要加锁,结果没答上来。自己写了一个程序 ...
相关推荐
Java数据库连接池是一种重要的资源管理技术,用于优化数据库应用程序的性能和效率。它通过复用已建立的数据库连接,避免了频繁创建和销毁连接带来的开销。以下是对压缩包文件中涉及的几个主要连接池组件的详细介绍:...
在现代农业生产中,肥料的施用对于作物的产量和质量有着决定性的影响。特别是对于那些需求量大的作物,比如水稻,其对钾肥(K肥)的响应尤为显著。本文主要研究在集约化水稻种植系统下,钾肥对土壤钾库、水稻产量、...
`android.support.v4.util.Pools`库提供了一种机制,帮助开发者有效地重用对象,从而节省内存并提高性能。这个库主要包含两种类型的池:`SynchronizedPool`和`SimplePool`,它们都是基于对象池的设计模式。 ### 1. ...
Ability to clear a single connection pool or all connection pools. DDEX provider now works under Visual Studio 2008 Batched commands are now supported with MySqlDataAdapter Added MySqlScript class ...
Deploying and running or debugging the application in Geronimo 305 Summary 306 Chapter 12: Clustering 307 WADI 308 Updating deployment descriptor and deployment plan 308 Load balancing with ...
Install Web and application server components Learn core techniques for managing IIS Configure Web sites, servers, and virtual directories Customize Web content, including error messages and ...
This script reads in the SERVER_NAME and #ADMIN_URL as positional parameters, sets the SERVER_NAME variable, then #starts the server. # #Other variables that startWLS takes are: # #WLS_USER - clear ...
You will begin with a basic understanding of memory management, and why memory leaks occur in an application, moving on to autorelease pools and object creation/storage to get an idea of how memory ...
- Set up the database schema and configure connection pools. 5. **Portal Configuration**: - Define the portal structure, including pages, portlets, and navigation elements. - Customize the look ...
elasticsearch-py uses persistent connections inside of individual connection pools (one per each configured or sniffednode). Outoftheboxyoucanchoosebetweentwo ...
They have been debugged and tested in both 32-bit and 64-bit versions, on single and multiprocessor systems, and under Windows 7, Vista, Server 2008, and Windows XP. To clarify program operation, ...
自己写好的对象池,可以拿下来直接用,挺简单的哈,为什么要50个字的描述,能说清楚不久得了,希望改进XXXXXXXXXXXXXXXXXXXX
They have been debugged and tested in both 32-bit and 64-bit versions, on single and multiprocessor systems, and under Windows 7, Vista, Server 2008, and Windows XP. To clarify program operation, ...
- 在Services树下展开JDBC子树,选择`Connection Pools`,然后点击`Configure a new JDBC Connection Pool...`。 - 在Database Type中选择对应的数据库类型,例如Oracle,并在Database Driver中选择`Oracle's ...
DataSource Objects and Connection Pools 530 Resource Injection 531 Resource Adapters and Contracts 534 Metadata Annotations 538 Common Client Interface 540 Further Information about Resources 541...
Further, you'll learn about server scalability, asynchronous I/O, and thread pools, and write responsive traditional Windows and Windows Store applications. By the end of the book, you will be able ...
Further, you'll learn about server scalability, asynchronous I/O, and thread pools, and write responsive traditional Windows and Windows Store applications. By the end of the book, you will be able ...
Memory Pools V1.2 可能是这个内存池管理库的最新版本,它提供了更高效、更可控的内存分配策略。 内存池的基本思想是预先在程序启动时或者运行时一次性申请一大块连续的内存空间,然后将这块内存分割成多个固定大小...
标题"Preverifier.rar_Pools"暗示了这个工具或者库专注于对程序类池(Class Pools)中的方法进行预验证。类池是Java虚拟机(JVM)在编译期间创建的一个数据结构,它存储了类和接口的信息,包括常量、字段和方法。在...