You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Rushikesh.Pisal" <ru...@gmail.com> on 2011/04/15 07:01:02 UTC

Embbeded tomcat utilizing more CUP Usage.

Hello, 

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. 
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. 
If we remove calling of embeded tomcat from our application then CPU usage
also get reduced from 50% to 20% so . 

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

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. 

Please share if you have any idea about how to tell embeded tomcat to use
less resource or some way to tune it. 
-- 
View this message in context: http://old.nabble.com/Embbeded-tomcat-utilizing-more-CUP-Usage.-tp31402755p31402755.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Embbeded tomcat utilizing more CUP Usage.

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Rushikesh,

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
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk2omwMACgkQ9CaO5/Lv0PDxywCfXgvuGLEbe74nJWhHauSKt2kD
EfUAoKObCJqyNfeWvse1C20V9BNsPmhF
=SM7u
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org