-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: tomcat hanging issue!
PostPosted: Tue Nov 09, 2010 9:28 am 
Beginner
Beginner

Joined: Mon Oct 27, 2008 6:26 am
Posts: 36
Greeting,

We are running our web application on tomcat6 in cloud server. Filesystem is ext3, disk total is 160Gb, 4 x CPU@2200Mhz. Memory is 4Gb.

Recently, the site hanging happened many times. The site is totally unresponsive in the hung state. I can only see a loading status in browser. As a result, we have to restart tomcat. Online users seemed not too high at hunging time. No special clues can be found in log file. We can still use command to communicate with mysql server. Can anyone provide me some clues to investigate?

I think there is something wrong with database connection or pool. If so, I also hope someone can provide me some suggestion on parameters of database pool configuration (c3p0).

Tools we are using: Lucene2.1.0, hibernate search3.2.0 , hibernate 3.5.0 and spring2.5 Database: mysql

I set max_connections in mysql to 300.

Datasource is configured as follows:

<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
<property name="driverClass" value="com.mysql.jdbc.Driver"/>
<property name="jdbcUrl" value="jdbc:mysql://localhost:3306/database_v3"/>
<property name="maxPoolSize" value="200"/>
<property name="minPoolSize" value="5"/>
<property name="acquireIncrement" value="5"/>
<property name="maxIdleTime" value="300"/>
<property name="maxStatements" value="100"/>
<property name="numHelperThreads" value="3"/>
<property name="breakAfterAcquireFailure" value="false"/>
<property name="testConnectionOnCheckout" value="false"/>
<property name="checkoutTimeout" value="2000"/>
<property name="acquireRetryDelay" value="1000"/>
<property name="acquireRetryAttempts" value="60"/>
<property name="idleConnectionTestPeriod" value="60"/>
<property name="properties">
<props>
<prop key="user">root</prop>
<prop key="password">password</prop>
</props>
</property>
</bean>


Top
 Profile  
 
 Post subject: Re: tomcat hanging issue!
PostPosted: Tue Nov 09, 2010 9:33 am 
Senior
Senior

Joined: Fri Oct 08, 2010 8:44 am
Posts: 130
300 connections is a huge number (use something like 20). Nevertheless I doubt it is a hanging cause. Use remote debugger or profiler to check where the site hangs.


Top
 Profile  
 
 Post subject: Re: tomcat hanging issue!
PostPosted: Tue Nov 09, 2010 10:03 am 
Beginner
Beginner

Joined: Mon Oct 27, 2008 6:26 am
Posts: 36
r,

The default of "max connection" in mysql is 100. I set maxPoolSize to 200 in c3p0 configuration. Considering a different service uses same mysql server, I increased "max connection" in mysql to 300.

Ian


Top
 Profile  
 
 Post subject: Re: tomcat hanging issue!
PostPosted: Tue Nov 09, 2010 10:31 am 
Beginner
Beginner

Joined: Mon Oct 27, 2008 6:26 am
Posts: 36
r wrote:
300 connections is a huge number (use something like 20). Nevertheless I doubt it is a hanging cause. Use remote debugger or profiler to check where the site hangs.



r,

can you recommend a profiler tools for me?

thanks


Top
 Profile  
 
 Post subject: Re: tomcat hanging issue!
PostPosted: Tue Nov 09, 2010 4:18 pm 
Senior
Senior

Joined: Fri Oct 08, 2010 8:44 am
Posts: 130
I would first try to use built-in debugger. Just run tomcat in debug mode. Then connect to it and list all the threads. You should see where the main thread hanged-up. If this is really connection or pool related you will see that the thread hanged on connection opening.

This could, for example, happen if your application is not releasing connections after usage. You could also try to check MySQL monitoring tools to check if all possible pool connections are indeed busy when server hangs.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.