tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: Embbeded tomcat utilizing more CUP Usage.
Date Fri, 15 Apr 2011 19:22:43 GMT
Hash: SHA1


On 4/15/2011 1:01 AM, Rushikesh.Pisal wrote:
> While running two instance of embedded tomcat in our application the CPU
> usage gets 100%. 


> We are using Tomcat 5.0.30 version. 
>  I know Tomcat 5.X is bit old but it is very much danger for project to 
> replace at this point of time. 

That's too bad. You do know that Tomcat 5.0.x is no longer supported --
even for security updates? That could be dangerous, too...

> Secondly , We are using only one servlet in our application,it just take 
> request n do some processing and send response. So there are no looping 
>  which can hock the CPU. 

Are you sure?

> If we remove calling of embeded tomcat from our application then CPU usage
> also get reduced from 50% to 20% so . 

That seems like a lot to me, but you know your application better than I do.

> It is sure that when I strat TOMCAT it is taking more CPU Usage. 
> Is there any steps/configuration to reduce CPU usage? 

Can you post all the code you use to embed Tomcat? Specifically, what do
you do /after/ you call Tomcat's startup routines?

> I have found some ways in some website i.e. maxThreads="50"
> minSpareThreads="5" maxSpareThreads="20" acceptCount="100"
> connectionTimeout="2000"/> 
> since embeded tomcat does not use server.xml file and I am not able to find
> programmitical way to do this. 

These are all configured on the Connector that you create yourself. You
can set these values before you add the Connector to Tomcat.

Tomcat does not really use any CPU resource when no requests are being
serviced. Seeing your code would be very helpful.

- -chris
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla -


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message