Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have 2 setups tomcat5.5.20 on Redhat and mysql 4.1.22 on another Redhat server.

Recently my webserver started getting overloaded up to 80-90%.

After checking i found repeating errors(each seconds) in catalina.out. Can it cause the server overload or where else can be the root of the problem ?

catalina.out:

DBCP object created 2010-12-22 13:33:12 by the following code was never closed:
java.lang.Exception
 at org.apache.tomcat.dbcp.dbcp.AbandonedTrace.init(AbandonedTrace.java:96)

i have to restart tomcat once a day when server load reaches 80-90%. Also catalina.out file is growing too fast which every few hours need to clear the logs.

My datasource config:

 <bean id="myDataSource"
    class="org.apache.tomcat.dbcp.dbcp.BasicDataSource"
    destroy-method="close">
    <property name="driverClassName">
        <value>com.mysql.jdbc.Driver</value>
    </property>

jdbc:mysql://XXX/XXX?autoReconnect=true 20 20

    <property name="maxIdle">
        <value>50</value>
    </property>

    <property name="maxActive">
        <value>50</value>
    </property>

    <property name="removeAbandoned">
        <value>false</value>
    </property>

    <property name="removeAbandonedTimeout">
        <value>2400</value>
    </property> 
    <property name="username">
        <value>XXX</value>
    </property>  
    <property name="password">
        <value>XXX</value>
    </property>
</bean>

Thanks for any direction.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

I'm not sure I have sufficient information to really evaluate your circumstance, but given what you have provided, I give you the following guess: change false to true.

    <property name="removeAbandoned">
        <value>false</value>
    </property>

I imagine your code is opening things and then not closing them before ending.

share|improve this answer
    
Ok, thanks for ur comments, i will try it out. –  taras Dec 29 '10 at 17:41
    
seems it fixed the issue, now the server load is normal. thanks a lot. –  taras Dec 30 '10 at 1:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.