Java Messaging Service tuning parameters
Use the administrative console to tune Java Messaging Service (JMS) run-time components, resources, and the embedded messaging server. For more information, see Administer the embedded JMS server and Administer JMS servers in Network Deployment.
Note: If you are not using JMS in your application server, it is recommended that you disable it. (By default, JMS is not enabled in the default instance. See Default instances for more information.) You can disable JMS when you create an application server instance with the crtwasinst script, or with the chgwassvr script in an existing instance. For more information, see The crtwasinst script and The chgwassvr script. The JMS service consumes a low amount of resources during runtime, but can cause significant increases in the start and stop times for your application server.
- Listener service
- Thread pool
- Description: The thread pool determines the maximum number of threads that the Message Listener Service can run. Adjust this parameter when multiple message-driven beans are deployed in the same application server and the sum of their maximum session values exceeds the default value of 10.
- How to view or set:
- Start the administrative console.
- In the topology tree, expand Servers and click Application Servers.
- Click the name of the application server that you want to configure.
- Click Message Listener Service.
- On the Message Listener Service page, click Thread Pool.
- Edit the thread pool settings as needed.
- Click Apply or OK.
- Save the configuration.
- Stop and restart the application server.
- Default value: Minimum: 10; Maximum: 50
- Recommended value: Set the minimum to the sum of all message-driven beans maximum session values. Set the maximum to a value equal to or greater than the minimum.
- Custom properties
- Application Server Facilities and Non-Application Server Facilities
- Description: The JMS server has two modes of operation: Application Server Facilities (ASF) and non-ASF. ASF mode is meant to provide concurrency and transactional support for applications. Non-ASF bypasses that support to streamline the path length. The value is the number of milliseconds that are required for a message to be delivered.
- How to view or set:
- Start the administrative console.
- In the topology tree, expand Servers and click Application Servers.
- Click the name of the application server that you want to configure.
- Click Message Listener Service.
- On the Message Listener Service page, click Thread Pool.
- Edit the thread pool settings as needed.
- Click Apply or OK.
- Save the configuration.
- Stop and restart the application server.
- Default value: ASF mode (no custom property)
- Recommended value: It is recommended that you set this value lower than the transaction timeout by 10 or more seconds. The difference should be larger under extreme loads in which threads are waiting long periods of time to get CPU cycles. Use Non-ASF mode in these situations:
- Message order is a strict requirement
- You want concurrent PTP messages
- The property non.asf.receive.timeout exists and has a value greater than 0
Do not use Non-ASF mode if you want concurrent publications and subscriptions messages. In this situation, ASF mode provides better throughput.
- Listener port
- Maximum sessions
- Description: This parameter specifies the maximum number of concurrent JMS server sessions that a listener uses to process messages.
- How to view or set:
- Start the administrative console.
- In the topology tree, expand Servers and click Application Servers.
- Click the name of the application server that you want to configure.
- Click Message Listener Service.
- On the Message Listener Service page, click Listener Ports.
- Click the name of the listener port.
- Specify a value in the Maximum sessions field.
- Click Apply or OK.
- Save the configuration.
- Stop and restart the application server.
- Default value: 1
- Recommended value: If you want to use message concurrency (multiple messages processed simultaneously), set the value to 2-4 sessions per system processor. Specify the lowest possible value to eliminate client thrashing. If you want a strict message order, set the value to 4. This value ensures that there is always a thread waiting in a hot state, blocked on receiving the message.
- Maximum messages
- Description: This parameter specifies the maximum number of messages that the listener can process in one JMS server session.
- How to view or set:
- Start the administrative console.
- In the topology tree, expand Servers and click Application Servers.
- Click the name of the application server that you want to configure.
- Click Message Listener Service.
- On the Message Listener Service page, click Listener Ports.
- Click the name of the listener port.
- Specify a value in the Maximum messages field.
- Click Apply or OK.
- Save the configuration.
- Stop and restart the application server.
- Default value: 1
- Recommended value: If you want to use message concurrency, set the value to 2-4 sessions per system processor. Specify the lowest possible value to eliminate client thrashing. If you want a strict message order, set the value to 1.
- JMS resources
- XA enabled
- Description: This attribute specifies whether the connection factory is for XA or non-XA coordination of messages. If you set this property to NON_XA, the JMS session is still enlisted in a transaction, but uses the resource manager local transaction calls (session.commit and session.rollback) instead of XA calls. As a result, performance might improve. However, only a single resource can be enlisted in a transaction in WebSphere Application Server.
- How to view or set:
- Start the administrative console.
- In the topology tree, expand Resources and click WebSphere JMS Provider or WebSphere MQ JMS Provider. This parameter does not apply to generic JMS providers.
- Click one of these links, depending on which provider you are using and which type of connection factory you want to configure:
- WebSphere Queue Connection Factories
- WebSphere Topic Connection Factories
- WebSphere MQ Queue Connection Factories
- WebSphere MQ Topic Connection Factories
- Click the name of the connection factory that you want to configure.
- Select or clear XA Enabled.
- Click Apply or OK.
- Save the configuration.
- Stop and restart the application server.
- Default value: By default, XA is enabled.
- Recommended value: Do not enable XA when the message queue or topic received is the only resource in the transaction. Enable XA when other resources, including other queues or topics, are involved.
- Connection pool size
- Description: The connection pool size specifies the maximum number of connections that the pool can contain. This parameter does not apply to generic JMS providers.
- How to view or set:
- Start the administrative console.
- In the topology tree, expand Resources.
- Navigate through one of these paths to the connection factory that you want to configure:
- WebSphere JMS Provider --> WebSphere Queue Connection Factories --> conn_ factory_name --> Connection Pool
- WebSphere JMS Provider --> WebSphere Topic Connection Factories --> conn_ factory_name --> Connection Pool
- WebSphere MQ JMS Provider --> WebSphere MQ Queue Connection Factories --> conn_ factory_name --> Connection Pool
- WebSphere MQ JMS Provider --> WebSphere MQ Topic Connection Factories --> conn_ factory_name --> Connection Pool
- Specify a value in the Max Connections field.
- Click Apply or OK.
- Save the configuration.
- Stop and restart the application server.
- Default value: 10
- Recommended value: For the connection pool size, specify a value lower than the value for the Max Connections option in the Web container. Lower settings, such as 10-30 connections, perform better than higher settings, such as 100.
- WebSphere MQ queue connection factory transport type
- Description: The transport type specifies whether the WebSphere MQ client connection or JNI bindings are used for connection to the WebSphere MQ queue manager.
- How to view or set:
- Start the administrative console.
- In the topology tree, expand Resources and click WebSphere MQ JMS Provider.
- Click WebSphere MQ Queue Connection Factories.
- Click the name of the connection factory that you want to configure.
- For Transport Type, select a value from the drop-down list.
- Click Apply or OK.
- Save the configuration.
- Stop and restart the application server.
- Default value: Bindings
- Recommended value: BINDINGS is faster by 30% or more, but it lacks security. It is recommended that if you have security concerns, use BINDINGS.
- WebSphere MQ topic connection factory transport type
- Description: The transport type specifies whether the WebSphere MQ client connection or JNI bindings are used for connection to the WebSphere MQ queue manager.
- How to view or set:
- Start the administrative console.
- In the topology tree, expand Resources and click WebSphere MQ JMS Provider.
- Click WebSphere MQ Topic Connection Factories.
- Click the name of the connection factory that you want to configure.
- For Transport Type, select a value from the drop-down list.
- Click Apply or OK.
- Save the configuration.
- Stop and restart the application server.
- Default value: Bindings
- Recommended value: DIRECT is the fastest, and is the recommended setting. However, if you wantto satisfy additional security tasks and the queue manager is local to the JMS client, specify BINDINGS. For all other cases, specify QUEUED.
- Transaction log directory
- Description: This parameter specifies the directory that contains transaction logs. When an application accesses more then one resource, WebSphere Application Server stores transaction information to properly coordinate and manage the distributed transaction.
- How to view or set:
- Start the administrative console.
- In the topology tree, expand Servers and click Application Servers.
- Click the name of the applicaiton server that you want to configure.
- Click Transaction Service.
- Specify a value for the Transaction log directory field.
- Click Apply or OK.
- Save the configuration.
- Stop and restart the application server.
- Default value: /QIBM/UserData/WebAS5/edition/instance/tranlog, where edition is Base for WebSphere Application Server and ND for WebSphere Application Server Network Deployment, and instance is the name of your application server instance.
- Recommended value: Storing transaction data can have a negative impact on performance. To improve performance, you can move the transaction log to a storage device with more physical disk drives or with Redundant Array of Independent Disks (RAID) disk drives.
- Embedded JMS server
- Number of threads
- Description: With the embedded JMS publications and subscriptions server, this value is the number of threads to use for the publications and subscriptions matching engine, which matches publications to subscribers. Use this parameter when concurrent publications and subscriptions exist that would exceed the capacity of the default value.
- How to view or set:
- Start the administrative console.
- In the topology tree, expand Servers and click Application Servers.
- Click the name of the application server that you want to configure.
- Click Server Components.
- Click JMS Servers.
- Specify a value for the Number of threads field.
- Click Apply or OK.
- Save the configuration.
- Stop and restart the application server.
- Default value: 1
- Recommended value: Set this value slightly higher than the number of concurrent message publishers. If large numbers of subscribers exist, increasing this value can also provide some benefit.