Configuring sessions in sonic 8

Posted by habin123 on 02-Jul-2011 12:56

Hi,

I have an esb container which is creating 168 sessions for a particular connection in my local sonic 8.0.1 domain.
When I move this container to development environment (sonic 8.0.1), I’m getting below exception during the startup of container.
[11/07/01 14:04:23] ID=esbMACC01 (warning) [ESBContainer] Failed to:Add session:MACC.Transformation_29
[11/07/01 14:04:23] ID=esbMACC01 (warning) Trace follows...
javax.jms.JMSException: Error creating session: maximum session(s) per connection = 150
at progress.message.jimpl.JMSExceptionUtil.createJMSException(JMSExceptionUtil.java:42)
at progress.message.jimpl.Session.<init>(Session.java:566)
at progress.message.jimpl.Connection.createSession(Connection.java:3292)
at com.sonicsw.xq.connector.jms.messagingbean.Session.createSession(Session.java:536)
at com.sonicsw.xq.connector.jms.messagingbean.MessagingBean.addSession(MessagingBean.java:631)
at com.sonicsw.xq.connector.jms.messagingbean.MessagingBean.applyHistoryStruct(MessagingBean.java:901)
at com.sonicsw.xq.connector.jms.messagingbean.MessagingBean.activateJmsSessions(MessagingBean.java:837)
at com.sonicsw.xq.connector.jms.messagingbean.MessagingBean.reconnect(MessagingBean.java:809)
at com.sonicsw.xq.connector.jms.JMSEndpoint$EndpointConnection$CloseHandler.handleConnectionLoss(JMSEndpoint.java:829)
at com.sonicsw.xq.connector.jms.JMSEndpoint$EndpointConnection$CloseHandler.run(JMSEndpoint.java:729)
Caused by: [151] progress.message.client.ESessionLimitExceeded: Error creating session: maximum session(s) per connection = 150
at progress.message.zclient.Connection.connectWithRecoveryOpt(Connection.java:1878)
at progress.message.zclient.Connection.connect(Connection.java:1648)
at progress.message.zclient.Connection.connect(Connection.java:1959)
at progress.message.jimpl.Session.<init>(Session.java:500)
... 8 more
During the startup of container I observed that, as soon as the number of session reaches 150 for this connection, the above exception is thrown. It seems that there is some upper limit (150) of session set for connection in our environment.
  1. Is there way I can change the number of session for a connection?
  2. Is there an optimum value for session above which the performance can be impacted and we should create a new connection?
Thanks in advance,
Habin

All Replies

Posted by pmeadows on 03-Jul-2011 02:35

Check for CONNECTION_TUNING_PARAMETERS.MAX_SESSIONS_PER_CONNECTION in the broker's Advanced Properties: go to the broker's properties in the SMC's Config view, select the 'Advanced' tab, then click the 'Edit...' button.

By default there's no limit on the number of sessions per connection.  I suspect the limit was set on your broker either as a preventative measure against potential rogue clients, or to help debug/diagnose a client that was leaking sessions or using an unexpectedly large number of sessions.

Thanks, Paul.

Posted by pmeadows on 04-Jul-2011 03:58

A further comment on this.  A couple of hundred sessions on a connection would be pretty unusual in a standalone JMS application, but it's not particularly uncommon for an ESB container and shouldn't cause any problems.

Say you've got 15 services deployed in an ESB Container each configured with an entry endpoint and 10 listeners.  This results in 150 sessions, plus there are additional pools of sessions for sends (see the ESB Connection config).

If you have services that you know are only ever invoked via intracontainer messaging you can omit the entry endpoint for those services (still leaving an appropriate listener count set) and thereby cut down somewhat on JMS resources.

Posted by habin123 on 04-Jul-2011 09:46

Thanks a lot Paul.
One question is still in my mind: Is there any optimum value for sessions per connection after which performance can degrade?
Thanks,
Habin

Posted by pmeadows on 04-Jul-2011 10:34

I'm not aware of any known figures for optimum numbers of sessions per connection. There are ESB containers out there running with 1,000+ sessions.  By that point I'd tend to be asking whether all those sessions are really needed, and I suspect a good chunk of them are not actively or heavily used, but they're there and not causing any obvious issues.

The message volume and number of parallel message flows is probably more relevant than the number of sessions as such.  Messaging on the various sessions is ultimately multiplexed through a single socket if the sessions are all using the same connection, so at some point it may be beneficial to move to a handful of connections, but I personally haven't done any performance testing in this area.  Others may be able to chip in here, but if you're concerned about performance you may need to experiment a little with your specific test scenarios.

Sorry I can't provide anything more concrete just now.

Thanks, Paul.

Posted by habin123 on 11-Jul-2011 03:56

Thanks a lot Paul

This thread is closed