activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Arjen van der Meijden <acmmail...@tweakers.net>
Subject Re: Too many open files
Date Mon, 13 Jan 2014 12:07:33 GMT
By default, ActiveMQ closes connections asynchronously. That is normally 
not a problem, unless you open and close many connections (in our case, 
hundreds per minute).
In that case, the asynchronous closing may not be able to keep up with 
your opening/closing-rate and you start accumulating file descriptors.

There is a transport-level configuration switch that you can set in your 
activemq.xml to switch that to synchronous:

We have it for stomp:
<transportConnector name="stomp" 
uri="stomp://0.0.0.0:61613?transport.closeAsync=false" />

But as said, this should not happen when you have just a low open/close 
rate.

By the way, if you allow 1000 connections at maximum and expect to get 
close to that number... you'll need to raise the limit on most 
Linux-distro's. The default tends to be 1024 (but that's not enough for 
1000 connections, since you need to account for file descriptors for 
libraries, storage files, etc).

We have added this to our /etc/init.d/activemq-script
ulimit -n 102400

Best regards,

Arjen

On 13-1-2014 10:09, Michael Priess wrote:
> Hi,
>
> hi I actually use Apache Camel 2.10.1 in combination with ActiveMQ 5.7.0.
>
> To build a connection to ActiveMQ I use the ActiveMQ ConnectionFactory.
> After a while I get this exception:
>
> 2013-12-21 04:16:51,442 | ERROR | Could not accept connection :
> java.net.SocketException: Too many open files |
> org.apache.activemq.broker.TransportConnector | ActiveMQ Transport Server:
> tcp://
> 0.0.0.0:61616?maximumConnections=1000&wireformat.maxFrameSize=104857600
>
> Is there a way how to find which client open so much connections? Is there
> a reason why ActiveMQ doesn't close this connections?
> Any idea how to debug such an issue?
>
> Regards,
>
> Michael
>

Mime
View raw message