Question

I'm running into a problem every two months or so. My activemq server dies and the log is full with SocketExceptions.

I have a PHP application using stomp to send messages to ActiveMQ and a Java application to consume the messages.

I have activemq on another server where only java applications are used when sending/consuming messages and it has never failed like this. I think there is somthing wrong with Stomp.

The stomp code is very basic and does not send anything odd. Only messages with message properties set. The stomp code closes the connection after every message sent.

I've looked at lsof and there is nothing out of order there.

netstat does however have alot of:

tcp6 0 0 127.0.0.1:61616 127.0.0.1:46280 CLOSE_WAIT

And the ActiveMQ Log shows alot of this

2011-04-28 12:43:09,819 | 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

I'm using:

ActiveMQ 5.4.2, Tomcat 6.0.20, Debian 5.0.3, PHP 5.2.6, Stomp revision 43

Was it helpful?

Solution

It seems that you are opening a lot connections in your java program, and then you are hitting your ulimit -n. Close Connections after usage or use a connection pool.

As a wourkaround you can raise your open file limit via sysctl, see a tutorial here.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top