You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Lists <li...@dankeeley.co.uk> on 2008/05/02 14:42:18 UTC

CPU usage quirk with multiple tomcat instances

Hi,

We have a Tomcat app that is loadbalanced by hardware.  I have 4 boxes
available in our test env, all of which vary slightly but not massively in
spec.

Anyway I moved from 2 tomcat instances on each machine ( listening on
different ports ) down to 1 and I noticed for the same load the cpu
utilisation dropped by 20%.  Interesting, how can this be explained?  Is
this the extra effort in tomcat or something?  Or is it memory related? the
2 instances had 1gb each, and the single one has been given 4gb.  However I
have jprofiled the instance and it has never seemed memory hungry.  Anyway I
suspect even at 2gb for 1 instance it would still be 20% less cpu - i can
always do a run to prove this if people think that necessary..

Another thing i've found is that on one server I have abnormally high CPU
utilisation for the same load.  I've checked the logging levels are all the
same as are the java VM and the VM config settings.  I wonder what else
could cause this?  All i can think is some sort of OS or hardware
malfunction! maybe the CPU cache is duff or something.

Many thanks to any input to my Friday weird-ness!
Dan

________________________________________________
Message sent using UebiMiau 2.7.10



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


Re: CPU usage quirk with multiple tomcat instances

Posted by David kerber <dc...@verizon.net>.
Lists wrote:
> Hi,
>
> We have a Tomcat app that is loadbalanced by hardware.  I have 4 boxes
> available in our test env, all of which vary slightly but not massively in
> spec.
>
> Anyway I moved from 2 tomcat instances on each machine ( listening on
> different ports ) down to 1 and I noticed for the same load the cpu
> utilisation dropped by 20%.  Interesting, how can this be explained?  Is
>   
My guess (and that's all it is) is that you have eliminated much of the 
context-switching overhead that two instances would have compared to one.

> this the extra effort in tomcat or something?  Or is it memory related? the
> 2 instances had 1gb each, and the single one has been given 4gb.  However I
> have jprofiled the instance and it has never seemed memory hungry.  Anyway I
> suspect even at 2gb for 1 instance it would still be 20% less cpu - i can
> always do a run to prove this if people think that necessary..
>
> Another thing i've found is that on one server I have abnormally high CPU
> utilisation for the same load.  I've checked the logging levels are all the
> same as are the java VM and the VM config settings.  I wonder what else
> could cause this?  All i can think is some sort of OS or hardware
> malfunction! maybe the CPU cache is duff or something.
>   
What is this cpu (type and speed) compared to the others?  If it's a 
slower or less-capable (no numeric coprocessor, etc) cpu, the same load 
would be a high percentage of its capability.

> Many thanks to any input to my Friday weird-ness!
> Dan
>   



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


Re: CPU usage quirk with multiple tomcat instances

Posted by Leon Rosenberg <ro...@googlemail.com>.
btw, how do you measure it? vmstats? top?

On Wed, May 7, 2008 at 9:40 AM, Dan Keeley <li...@dankeeley.co.uk> wrote:
> We dont have synchronisation issues - I've already profiled extensively with
> jprofiler..  Well we did, but after using jprofiler we dont :)
>
>  Err, I think our app is the same as yours :) What im saying is that for the
> same load the machine uses more cpu with 2 tomcat instances...  So i guess
> that is correct, i was just looking for why!
>
>  Dan

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


Re: CPU usage quirk with multiple tomcat instances

Posted by Dan Keeley <li...@dankeeley.co.uk>.
We dont have synchronisation issues - I've already profiled extensively with 
jprofiler..  Well we did, but after using jprofiler we dont :)

Err, I think our app is the same as yours :) What im saying is that for the 
same load the machine uses more cpu with 2 tomcat instances...  So i guess 
that is correct, i was just looking for why!

Dan
----- Original Message ----- 
From: "Leon Rosenberg" <ro...@googlemail.com>
To: "Tomcat Users List" <us...@tomcat.apache.org>; "Lists" 
<li...@dankeeley.co.uk>
Sent: Tuesday, May 06, 2008 9:33 AM
Subject: Re: CPU usage quirk with multiple tomcat instances


> Hello Dan,
>
> what also may happening is that you have unneeded or errorneous
> synchronisation somewhere in your code. Two instances : less code in
> same block and vm, effectively less synchronization.
>
> try to profile whether some use cases take longer on the single tomcat
> per machine.
>
> We once tried to run multiple tomcats on one machine and the results
> where opposed to yours: less performance, so i think your app behaves
> "funny" :-)
>
> regards
> Leon
>
>
> On Fri, May 2, 2008 at 2:42 PM, Lists <li...@dankeeley.co.uk> wrote:
>> Hi,
>>
>>  We have a Tomcat app that is loadbalanced by hardware.  I have 4 boxes
>>  available in our test env, all of which vary slightly but not massively 
>> in
>>  spec.
>>
>>  Anyway I moved from 2 tomcat instances on each machine ( listening on
>>  different ports ) down to 1 and I noticed for the same load the cpu
>>  utilisation dropped by 20%.  Interesting, how can this be explained?  Is
>>  this the extra effort in tomcat or something?  Or is it memory related? 
>> the
>>  2 instances had 1gb each, and the single one has been given 4gb. 
>> However I
>>  have jprofiled the instance and it has never seemed memory hungry. 
>> Anyway I
>>  suspect even at 2gb for 1 instance it would still be 20% less cpu - i 
>> can
>>  always do a run to prove this if people think that necessary..
>>
>>  Another thing i've found is that on one server I have abnormally high 
>> CPU
>>  utilisation for the same load.  I've checked the logging levels are all 
>> the
>>  same as are the java VM and the VM config settings.  I wonder what else
>>  could cause this?  All i can think is some sort of OS or hardware
>>  malfunction! maybe the CPU cache is duff or something.
>>
>>  Many thanks to any input to my Friday weird-ness!
>>  Dan
>>
>>  ________________________________________________
>>  Message sent using UebiMiau 2.7.10
>>
>>
>>
>>  ---------------------------------------------------------------------
>>  To start a new topic, e-mail: users@tomcat.apache.org
>>  To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>  For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>
>
> -- 
> No virus found in this incoming message.
> Checked by AVG.
> Version: 7.5.524 / Virus Database: 269.23.9/1418 - Release Date: 5/6/2008 
> 5:17 PM
>
> 


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


Re: CPU usage quirk with multiple tomcat instances

Posted by Leon Rosenberg <ro...@googlemail.com>.
Hello Dan,

what also may happening is that you have unneeded or errorneous
synchronisation somewhere in your code. Two instances : less code in
same block and vm, effectively less synchronization.

try to profile whether some use cases take longer on the single tomcat
per machine.

We once tried to run multiple tomcats on one machine and the results
where opposed to yours: less performance, so i think your app behaves
"funny" :-)

regards
Leon


On Fri, May 2, 2008 at 2:42 PM, Lists <li...@dankeeley.co.uk> wrote:
> Hi,
>
>  We have a Tomcat app that is loadbalanced by hardware.  I have 4 boxes
>  available in our test env, all of which vary slightly but not massively in
>  spec.
>
>  Anyway I moved from 2 tomcat instances on each machine ( listening on
>  different ports ) down to 1 and I noticed for the same load the cpu
>  utilisation dropped by 20%.  Interesting, how can this be explained?  Is
>  this the extra effort in tomcat or something?  Or is it memory related? the
>  2 instances had 1gb each, and the single one has been given 4gb.  However I
>  have jprofiled the instance and it has never seemed memory hungry.  Anyway I
>  suspect even at 2gb for 1 instance it would still be 20% less cpu - i can
>  always do a run to prove this if people think that necessary..
>
>  Another thing i've found is that on one server I have abnormally high CPU
>  utilisation for the same load.  I've checked the logging levels are all the
>  same as are the java VM and the VM config settings.  I wonder what else
>  could cause this?  All i can think is some sort of OS or hardware
>  malfunction! maybe the CPU cache is duff or something.
>
>  Many thanks to any input to my Friday weird-ness!
>  Dan
>
>  ________________________________________________
>  Message sent using UebiMiau 2.7.10
>
>
>
>  ---------------------------------------------------------------------
>  To start a new topic, e-mail: users@tomcat.apache.org
>  To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>  For additional commands, e-mail: users-help@tomcat.apache.org
>
>

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