You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Don Santillan <do...@gmail.com> on 2011/01/05 15:01:14 UTC

Too many open files

Hello,

I have an embedded activemq in my webapp and it is deployed in a jetty 
server. I believe that our server OS's file descriptor limit has enough 
value.

After a few days, the application crashed with the following error:

2011-01-05 00:34:40.000:WARN::EXCEPTION 
java.io.IOException: Too many open files        
	at sun.nio.ch.ServerSocketChannelImpl.accept0(Native Method)
        at sun.nio.ch.ServerSocketChannelImpl.accept(ServerSocketChannelImpl.java:145)
        at org.eclipse.jetty.server.nio.SelectChannelConnector$1.acceptChannel(SelectChannelConnector.java:74)        
	at org.eclipse.jetty.io.nio.SelectorManager$SelectSet.doSelect(SelectorManager.java:650)
        at org.eclipse.jetty.io.nio.SelectorManager.doSelect(SelectorManager.java:195)
        at org.eclipse.jetty.server.nio.SelectChannelConnector.accept(SelectChannelConnector.java:134)
        at org.eclipse.jetty.server.AbstractConnector$Acceptor.run(AbstractConnector.java:850)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:436)
        at java.lang.Thread.run(Thread.java:6


Is there a possibility that I have configured my activemq or persistence 
wrongly which caused this? Here's my activemq.xml:
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:amq="http://activemq.apache.org/schema/core" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
  http://activemq.apache.org/schema/core 
http://activemq.apache.org/schema/core/activemq-core.xsd">

    <broker xmlns="http://activemq.apache.org/schema/core"
        brokerName="devbroker" persistent="true"
        destroyApplicationContextOnStop="true"
        dataDirectory="/tmp/dev">
       
        <transportConnectors>
            <transportConnector name="openwire"
                uri="vm://devBroker" />
        </transportConnectors>

        <plugins>
            <statisticsBrokerPlugin />
        </plugins>

    </broker>

</beans>


I googled this and saw some posts telling this maybe caused by an 
improper setting on memory limit. I also saw some threads that says use 
kaha db for better persistence. How am I able to address both of this? 
Can I configure both using the activemq.xml alone? What are the 
appropriate values for an application that processes large amount of 
messages.

Can anyone point me to a good activemq.xml configuration that is good 
for production environment?


Thanks!
-don

Re: Too many open files

Posted by Don Santillan <do...@gmail.com>.
You mean by default, ActiveMQ is already using KahaDB?

Using the activemq.xml that I posted earlier, the logs show this:
2011-01-06 15:47:48,873  INFO BrokerService:462 - Using Persistence 
Adapter: AMQPersistenceAdapter(/tmp/dev/devbroker)
2011-01-06 15:47:48,882  INFO AMQPersistenceAdapter:177 - AMQStore 
starting using directory: /tmp/dev/devbroker
2011-01-06 15:47:48,988  INFO KahaStore:463 - Kaha Store using data 
directory /tmp/dev/devbroker/kr-store/state
2011-01-06 15:47:49,037  INFO AMQPersistenceAdapter:235 - Active data 
files: []

This means that I'm not using KahaDB, right? Or this is already KahaDB 
that is configured?

I also tried modifying the activemq.xml to use kahaDB instead of 
AMQPersistenceAdapter. Here's the new activemq.xml:
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:amq="http://activemq.apache.org/schema/core" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
  http://activemq.apache.org/schema/core 
http://activemq.apache.org/schema/core/activemq-core.xsd">

    <broker xmlns="http://activemq.apache.org/schema/core"
        brokerName="devbroker" persistent="true"
        destroyApplicationContextOnStop="true"
        dataDirectory="/tmp/dev">
       
        <persistenceAdapter>
            <kahaDB
                    directory="/tmp/dev/devbroker/kahaDB-data"
                    journalMaxFileLength="32mb" />
        </persistenceAdapter>
       
        <transportConnectors>
            <transportConnector name="openwire"
                uri="vm://devBroker" />
        </transportConnectors>

        <plugins>
            <statisticsBrokerPlugin />
        </plugins>

    </broker>

</beans>

Running the app with this configuration, the logs show this:
2011-01-06 16:44:22,974  INFO BrokerService:462 - Using Persistence 
Adapter: org.apache.activemq.store.kahadb.KahaDBPersistenceAdapter@36a55


Is this the proper configuration to enable KahaDB?

-don


Juan Nin wrote:
> I'm basically using the default config, with the things I don't use
> disabled, and several values tweaked based on the sample config files
> that come with ActiveMQ
>
>
> On Wed, Jan 5, 2011 at 3:24 PM, Don Santillan <do...@gmail.com> wrote:
>   
>> Thanks for the reply Juan!
>>
>> Can you give me a sample activemq.xml that enables KahaDB with production
>> level settings?
>>
>> -don
>>
>> Can you give me a
>>
>> Juan Nin wrote:
>>     
>>> We used to have this issue with ActiveMQ 5.2.x, so had to rise the
>>> file descriptors.
>>> Since we moved to ActiveMQ 5.3.x and KahaDB, we naver had that issue
>>> again.
>>>
>>> Regards,
>>>
>>> Juan
>>>
>>>
>>> On Wed, Jan 5, 2011 at 12:01 PM, Don Santillan <do...@gmail.com>
>>> wrote:
>>>
>>>       
>>>> Hello,
>>>>
>>>> I have an embedded activemq in my webapp and it is deployed in a jetty
>>>> server. I believe that our server OS's file descriptor limit has enough
>>>> value.
>>>>
>>>> After a few days, the application crashed with the following error:
>>>>
>>>> 2011-01-05 00:34:40.000:WARN::EXCEPTION java.io.IOException: Too many
>>>> open
>>>> files                at sun.nio.ch.ServerSocketChannelImpl.accept0(Native
>>>> Method)
>>>>      at
>>>>
>>>> sun.nio.ch.ServerSocketChannelImpl.accept(ServerSocketChannelImpl.java:145)
>>>>      at
>>>>
>>>> org.eclipse.jetty.server.nio.SelectChannelConnector$1.acceptChannel(SelectChannelConnector.java:74)
>>>>          at
>>>>
>>>> org.eclipse.jetty.io.nio.SelectorManager$SelectSet.doSelect(SelectorManager.java:650)
>>>>      at
>>>>
>>>> org.eclipse.jetty.io.nio.SelectorManager.doSelect(SelectorManager.java:195)
>>>>      at
>>>>
>>>> org.eclipse.jetty.server.nio.SelectChannelConnector.accept(SelectChannelConnector.java:134)
>>>>      at
>>>>
>>>> org.eclipse.jetty.server.AbstractConnector$Acceptor.run(AbstractConnector.java:850)
>>>>      at
>>>>
>>>> org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:436)
>>>>      at java.lang.Thread.run(Thread.java:6
>>>>
>>>>
>>>> Is there a possibility that I have configured my activemq or persistence
>>>> wrongly which caused this? Here's my activemq.xml:
>>>> <beans xmlns="http://www.springframework.org/schema/beans"
>>>>  xmlns:amq="http://activemq.apache.org/schema/core"
>>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>>  xsi:schemaLocation="http://www.springframework.org/schema/beans
>>>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
>>>>  http://activemq.apache.org/schema/core
>>>> http://activemq.apache.org/schema/core/activemq-core.xsd">
>>>>
>>>>  <broker xmlns="http://activemq.apache.org/schema/core"
>>>>      brokerName="devbroker" persistent="true"
>>>>      destroyApplicationContextOnStop="true"
>>>>      dataDirectory="/tmp/dev">
>>>>            <transportConnectors>
>>>>          <transportConnector name="openwire"
>>>>              uri="vm://devBroker" />
>>>>      </transportConnectors>
>>>>
>>>>      <plugins>
>>>>          <statisticsBrokerPlugin />
>>>>      </plugins>
>>>>
>>>>  </broker>
>>>>
>>>> </beans>
>>>>
>>>>
>>>> I googled this and saw some posts telling this maybe caused by an
>>>> improper
>>>> setting on memory limit. I also saw some threads that says use kaha db
>>>> for
>>>> better persistence. How am I able to address both of this? Can I
>>>> configure
>>>> both using the activemq.xml alone? What are the appropriate values for an
>>>> application that processes large amount of messages.
>>>>
>>>> Can anyone point me to a good activemq.xml configuration that is good for
>>>> production environment?
>>>>
>>>>
>>>> Thanks!
>>>> -don
>>>>
>>>>
>>>>         
>>>       
>
>   

Re: Too many open files

Posted by Juan Nin <ju...@gmail.com>.
I'm basically using the default config, with the things I don't use
disabled, and several values tweaked based on the sample config files
that come with ActiveMQ


On Wed, Jan 5, 2011 at 3:24 PM, Don Santillan <do...@gmail.com> wrote:
> Thanks for the reply Juan!
>
> Can you give me a sample activemq.xml that enables KahaDB with production
> level settings?
>
> -don
>
> Can you give me a
>
> Juan Nin wrote:
>>
>> We used to have this issue with ActiveMQ 5.2.x, so had to rise the
>> file descriptors.
>> Since we moved to ActiveMQ 5.3.x and KahaDB, we naver had that issue
>> again.
>>
>> Regards,
>>
>> Juan
>>
>>
>> On Wed, Jan 5, 2011 at 12:01 PM, Don Santillan <do...@gmail.com>
>> wrote:
>>
>>>
>>> Hello,
>>>
>>> I have an embedded activemq in my webapp and it is deployed in a jetty
>>> server. I believe that our server OS's file descriptor limit has enough
>>> value.
>>>
>>> After a few days, the application crashed with the following error:
>>>
>>> 2011-01-05 00:34:40.000:WARN::EXCEPTION java.io.IOException: Too many
>>> open
>>> files                at sun.nio.ch.ServerSocketChannelImpl.accept0(Native
>>> Method)
>>>      at
>>>
>>> sun.nio.ch.ServerSocketChannelImpl.accept(ServerSocketChannelImpl.java:145)
>>>      at
>>>
>>> org.eclipse.jetty.server.nio.SelectChannelConnector$1.acceptChannel(SelectChannelConnector.java:74)
>>>          at
>>>
>>> org.eclipse.jetty.io.nio.SelectorManager$SelectSet.doSelect(SelectorManager.java:650)
>>>      at
>>>
>>> org.eclipse.jetty.io.nio.SelectorManager.doSelect(SelectorManager.java:195)
>>>      at
>>>
>>> org.eclipse.jetty.server.nio.SelectChannelConnector.accept(SelectChannelConnector.java:134)
>>>      at
>>>
>>> org.eclipse.jetty.server.AbstractConnector$Acceptor.run(AbstractConnector.java:850)
>>>      at
>>>
>>> org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:436)
>>>      at java.lang.Thread.run(Thread.java:6
>>>
>>>
>>> Is there a possibility that I have configured my activemq or persistence
>>> wrongly which caused this? Here's my activemq.xml:
>>> <beans xmlns="http://www.springframework.org/schema/beans"
>>>  xmlns:amq="http://activemq.apache.org/schema/core"
>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>  xsi:schemaLocation="http://www.springframework.org/schema/beans
>>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
>>>  http://activemq.apache.org/schema/core
>>> http://activemq.apache.org/schema/core/activemq-core.xsd">
>>>
>>>  <broker xmlns="http://activemq.apache.org/schema/core"
>>>      brokerName="devbroker" persistent="true"
>>>      destroyApplicationContextOnStop="true"
>>>      dataDirectory="/tmp/dev">
>>>            <transportConnectors>
>>>          <transportConnector name="openwire"
>>>              uri="vm://devBroker" />
>>>      </transportConnectors>
>>>
>>>      <plugins>
>>>          <statisticsBrokerPlugin />
>>>      </plugins>
>>>
>>>  </broker>
>>>
>>> </beans>
>>>
>>>
>>> I googled this and saw some posts telling this maybe caused by an
>>> improper
>>> setting on memory limit. I also saw some threads that says use kaha db
>>> for
>>> better persistence. How am I able to address both of this? Can I
>>> configure
>>> both using the activemq.xml alone? What are the appropriate values for an
>>> application that processes large amount of messages.
>>>
>>> Can anyone point me to a good activemq.xml configuration that is good for
>>> production environment?
>>>
>>>
>>> Thanks!
>>> -don
>>>
>>>
>>
>>
>

Re: Too many open files

Posted by Don Santillan <do...@gmail.com>.
Thanks for the reply Juan!

Can you give me a sample activemq.xml that enables KahaDB with 
production level settings?

-don

Can you give me a

Juan Nin wrote:
> We used to have this issue with ActiveMQ 5.2.x, so had to rise the
> file descriptors.
> Since we moved to ActiveMQ 5.3.x and KahaDB, we naver had that issue again.
>
> Regards,
>
> Juan
>
>
> On Wed, Jan 5, 2011 at 12:01 PM, Don Santillan <do...@gmail.com> wrote:
>   
>> Hello,
>>
>> I have an embedded activemq in my webapp and it is deployed in a jetty
>> server. I believe that our server OS's file descriptor limit has enough
>> value.
>>
>> After a few days, the application crashed with the following error:
>>
>> 2011-01-05 00:34:40.000:WARN::EXCEPTION java.io.IOException: Too many open
>> files                at sun.nio.ch.ServerSocketChannelImpl.accept0(Native
>> Method)
>>       at
>> sun.nio.ch.ServerSocketChannelImpl.accept(ServerSocketChannelImpl.java:145)
>>       at
>> org.eclipse.jetty.server.nio.SelectChannelConnector$1.acceptChannel(SelectChannelConnector.java:74)
>>           at
>> org.eclipse.jetty.io.nio.SelectorManager$SelectSet.doSelect(SelectorManager.java:650)
>>       at
>> org.eclipse.jetty.io.nio.SelectorManager.doSelect(SelectorManager.java:195)
>>       at
>> org.eclipse.jetty.server.nio.SelectChannelConnector.accept(SelectChannelConnector.java:134)
>>       at
>> org.eclipse.jetty.server.AbstractConnector$Acceptor.run(AbstractConnector.java:850)
>>       at
>> org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:436)
>>       at java.lang.Thread.run(Thread.java:6
>>
>>
>> Is there a possibility that I have configured my activemq or persistence
>> wrongly which caused this? Here's my activemq.xml:
>> <beans xmlns="http://www.springframework.org/schema/beans"
>>   xmlns:amq="http://activemq.apache.org/schema/core"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>   xsi:schemaLocation="http://www.springframework.org/schema/beans
>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
>>  http://activemq.apache.org/schema/core
>> http://activemq.apache.org/schema/core/activemq-core.xsd">
>>
>>   <broker xmlns="http://activemq.apache.org/schema/core"
>>       brokerName="devbroker" persistent="true"
>>       destroyApplicationContextOnStop="true"
>>       dataDirectory="/tmp/dev">
>>             <transportConnectors>
>>           <transportConnector name="openwire"
>>               uri="vm://devBroker" />
>>       </transportConnectors>
>>
>>       <plugins>
>>           <statisticsBrokerPlugin />
>>       </plugins>
>>
>>   </broker>
>>
>> </beans>
>>
>>
>> I googled this and saw some posts telling this maybe caused by an improper
>> setting on memory limit. I also saw some threads that says use kaha db for
>> better persistence. How am I able to address both of this? Can I configure
>> both using the activemq.xml alone? What are the appropriate values for an
>> application that processes large amount of messages.
>>
>> Can anyone point me to a good activemq.xml configuration that is good for
>> production environment?
>>
>>
>> Thanks!
>> -don
>>
>>     
>
>   

Re: Too many open files

Posted by Juan Nin <ju...@gmail.com>.
We used to have this issue with ActiveMQ 5.2.x, so had to rise the
file descriptors.
Since we moved to ActiveMQ 5.3.x and KahaDB, we naver had that issue again.

Regards,

Juan


On Wed, Jan 5, 2011 at 12:01 PM, Don Santillan <do...@gmail.com> wrote:
> Hello,
>
> I have an embedded activemq in my webapp and it is deployed in a jetty
> server. I believe that our server OS's file descriptor limit has enough
> value.
>
> After a few days, the application crashed with the following error:
>
> 2011-01-05 00:34:40.000:WARN::EXCEPTION java.io.IOException: Too many open
> files                at sun.nio.ch.ServerSocketChannelImpl.accept0(Native
> Method)
>       at
> sun.nio.ch.ServerSocketChannelImpl.accept(ServerSocketChannelImpl.java:145)
>       at
> org.eclipse.jetty.server.nio.SelectChannelConnector$1.acceptChannel(SelectChannelConnector.java:74)
>           at
> org.eclipse.jetty.io.nio.SelectorManager$SelectSet.doSelect(SelectorManager.java:650)
>       at
> org.eclipse.jetty.io.nio.SelectorManager.doSelect(SelectorManager.java:195)
>       at
> org.eclipse.jetty.server.nio.SelectChannelConnector.accept(SelectChannelConnector.java:134)
>       at
> org.eclipse.jetty.server.AbstractConnector$Acceptor.run(AbstractConnector.java:850)
>       at
> org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:436)
>       at java.lang.Thread.run(Thread.java:6
>
>
> Is there a possibility that I have configured my activemq or persistence
> wrongly which caused this? Here's my activemq.xml:
> <beans xmlns="http://www.springframework.org/schema/beans"
>   xmlns:amq="http://activemq.apache.org/schema/core"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>   xsi:schemaLocation="http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
>  http://activemq.apache.org/schema/core
> http://activemq.apache.org/schema/core/activemq-core.xsd">
>
>   <broker xmlns="http://activemq.apache.org/schema/core"
>       brokerName="devbroker" persistent="true"
>       destroyApplicationContextOnStop="true"
>       dataDirectory="/tmp/dev">
>             <transportConnectors>
>           <transportConnector name="openwire"
>               uri="vm://devBroker" />
>       </transportConnectors>
>
>       <plugins>
>           <statisticsBrokerPlugin />
>       </plugins>
>
>   </broker>
>
> </beans>
>
>
> I googled this and saw some posts telling this maybe caused by an improper
> setting on memory limit. I also saw some threads that says use kaha db for
> better persistence. How am I able to address both of this? Can I configure
> both using the activemq.xml alone? What are the appropriate values for an
> application that processes large amount of messages.
>
> Can anyone point me to a good activemq.xml configuration that is good for
> production environment?
>
>
> Thanks!
> -don
>