You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Shurbann Martes <s....@gmail.com> on 2010/08/24 12:56:07 UTC

Multiple sockets connection TIME_WAIT

Hi ActiveMQ,

Thank you for taking time to answer my question.

I have the following issue. I'm using ActiveMQ in combination with Spring:

<bean
class="org.springframework.jms.listener.DefaultMessageListenerContainer">
<property name="connectionFactory" ref="pooledFactory" />
<property name="destination" ref="requestQueue" />
<property name="messageListener" ref="productRequestProcessorMdp" />
<property name="concurrentConsumers" value="1" />
<property name="maxConcurrentConsumers" value="5" />
<property name="transactionManager" ref="jmsTransactionManager" />
</bean>

It's using the TCP Transport: tcp://localhost:61616

This was working fine, until an increase in usage of the service lately:

I noticed lately that the amount of socket connection connecting on the port
61616 is huge (> 780) of which only 15 is ESTABLISHED and the other are
TIME_WAIT.

Lately my container/machine starts giving too many socket connections during
peek hours. (I've taken care of ulimit -n on OS level). Now I'm starting to
look at the connections of this machine and more then 80% is on the account
ActiveMQ.

My questions are
- Anyone have/had this problem?
- Is there a way of putting a max connection to the broker?
- How can I make the TIME_WAIT interval smaller?
- Any other suggestion of decreasing the amount of connections to the
broker?

Thank you in advance.

Regards,
SM

Re: Multiple sockets connection TIME_WAIT

Posted by Shurbann Martes <s....@gmail.com>.
You're right. I was using for the jmsTransactionManager
the org.apache.activemq.ActiveMQConnectionFactory instead of
the org.apache.activemq.pool.PooledConnectionFactory.

I will test this later. Thank you for your quick response.

Regards,
Shurbann Martes

On Tue, Aug 24, 2010 at 9:42 AM, Gary Tully <ga...@gmail.com> wrote:

> You need to look into the cache level, think the spring default is to
> cache nothing if there is a transaction manager present as there is in
> your case.
>
> You may want to try cache_connection at a minimum.
>
> There are OS TCP level config options to configure the TIME_WAIT
> window but it may be better to tackle the excessive connection
> creation a the jms application level.
>
> On 24 August 2010 11:56, Shurbann Martes <s....@gmail.com> wrote:
> > Hi ActiveMQ,
> >
> > Thank you for taking time to answer my question.
> >
> > I have the following issue. I'm using ActiveMQ in combination with
> Spring:
> >
> > <bean
> > class="org.springframework.jms.listener.DefaultMessageListenerContainer">
> > <property name="connectionFactory" ref="pooledFactory" />
> > <property name="destination" ref="requestQueue" />
> > <property name="messageListener" ref="productRequestProcessorMdp" />
> > <property name="concurrentConsumers" value="1" />
> > <property name="maxConcurrentConsumers" value="5" />
> > <property name="transactionManager" ref="jmsTransactionManager" />
> > </bean>
> >
> > It's using the TCP Transport: tcp://localhost:61616
> >
> > This was working fine, until an increase in usage of the service lately:
> >
> > I noticed lately that the amount of socket connection connecting on the
> port
> > 61616 is huge (> 780) of which only 15 is ESTABLISHED and the other are
> > TIME_WAIT.
> >
> > Lately my container/machine starts giving too many socket connections
> during
> > peek hours. (I've taken care of ulimit -n on OS level). Now I'm starting
> to
> > look at the connections of this machine and more then 80% is on the
> account
> > ActiveMQ.
> >
> > My questions are
> > - Anyone have/had this problem?
> > - Is there a way of putting a max connection to the broker?
> > - How can I make the TIME_WAIT interval smaller?
> > - Any other suggestion of decreasing the amount of connections to the
> > broker?
> >
> > Thank you in advance.
> >
> > Regards,
> > SM
> >
>
>
>
> --
> http://blog.garytully.com
>
> Open Source Integration
> http://fusesource.com
>

Re: Multiple sockets connection TIME_WAIT

Posted by Gary Tully <ga...@gmail.com>.
You need to look into the cache level, think the spring default is to
cache nothing if there is a transaction manager present as there is in
your case.

You may want to try cache_connection at a minimum.

There are OS TCP level config options to configure the TIME_WAIT
window but it may be better to tackle the excessive connection
creation a the jms application level.

On 24 August 2010 11:56, Shurbann Martes <s....@gmail.com> wrote:
> Hi ActiveMQ,
>
> Thank you for taking time to answer my question.
>
> I have the following issue. I'm using ActiveMQ in combination with Spring:
>
> <bean
> class="org.springframework.jms.listener.DefaultMessageListenerContainer">
> <property name="connectionFactory" ref="pooledFactory" />
> <property name="destination" ref="requestQueue" />
> <property name="messageListener" ref="productRequestProcessorMdp" />
> <property name="concurrentConsumers" value="1" />
> <property name="maxConcurrentConsumers" value="5" />
> <property name="transactionManager" ref="jmsTransactionManager" />
> </bean>
>
> It's using the TCP Transport: tcp://localhost:61616
>
> This was working fine, until an increase in usage of the service lately:
>
> I noticed lately that the amount of socket connection connecting on the port
> 61616 is huge (> 780) of which only 15 is ESTABLISHED and the other are
> TIME_WAIT.
>
> Lately my container/machine starts giving too many socket connections during
> peek hours. (I've taken care of ulimit -n on OS level). Now I'm starting to
> look at the connections of this machine and more then 80% is on the account
> ActiveMQ.
>
> My questions are
> - Anyone have/had this problem?
> - Is there a way of putting a max connection to the broker?
> - How can I make the TIME_WAIT interval smaller?
> - Any other suggestion of decreasing the amount of connections to the
> broker?
>
> Thank you in advance.
>
> Regards,
> SM
>



-- 
http://blog.garytully.com

Open Source Integration
http://fusesource.com