Re: when idle tomcat runs on 3.9% CPU

2015-02-27 Thread Rainer Jung

Am 27.02.2015 um 18:07 schrieb Christopher Schultz:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Peter,

On 2/27/15 11:21 AM, Peter Irbizon wrote:

Hi Chris, here are my dumps
http://www.filedropper.com/jvmthreaddump. It looks like it has
something to do with memcached.


There are a bunch of RUNNABLE threads, but sometimes the term
RUNNABLE in a Java thread dump doesn't actually mean taking CPU
time right now. For example, the main thread is RUNNABLE but it's
waiting on accepting a socket connection (for a SHUTDOWN command) and
so it's effectively blocked, taking zero CPU time.

I'm not entirely sure what the Memcached threads actually do, but I
think they are in a similar situation: waiting for code to request
some communication with Memcached.


I agree, hard to say from those dumps what's consuming the CPU, could be 
even GC threads. It's easier if threads are actually doing something, 
not just hanging around and waiting for work.


If you have commandline access, use

top -H -p PID

to show the list of threads of your process (replace PID by the process 
ID of your Java process) and check, what the thread numbers that are 
active on the CPU are. Hopefully it is only a few threads. Then take the 
thread number and translate it from decimal to hexadecimal and look for 
it in the header lines of your thread dumps.


Example:

The thread

Memcached IO over {MemcachedConnection to localhost/127.0.0.1:11215} 
prio=10 tid=0x025558d8 nid=0x34d3 runnable [0x9f4fe000]


from the dump will be shown on some Linuxes in top -H as thread id

0x34d3 = 13523

on others as

0x025558d8 = 39147736

If the thread ID doesn't occur in the thread dump at all, then it is 
native threads (unlikely but possible).


Regards,

Rainer

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



Re: when idle tomcat runs on 3.9% CPU

2015-02-27 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Peter,

On 2/27/15 11:21 AM, Peter Irbizon wrote:
 Hi Chris, here are my dumps
 http://www.filedropper.com/jvmthreaddump. It looks like it has
 something to do with memcached.

There are a bunch of RUNNABLE threads, but sometimes the term
RUNNABLE in a Java thread dump doesn't actually mean taking CPU
time right now. For example, the main thread is RUNNABLE but it's
waiting on accepting a socket connection (for a SHUTDOWN command) and
so it's effectively blocked, taking zero CPU time.

I'm not entirely sure what the Memcached threads actually do, but I
think they are in a similar situation: waiting for code to request
some communication with Memcached.

- -chris

 2015-02-27 16:46 GMT+01:00 Christopher Schultz
 ch...@christopherschultz.net
 :
 
 Peter,
 
 On 2/27/15 10:41 AM, Peter Irbizon wrote:
 2015-02-27 16:32 GMT+02:00 Christopher Schultz 
 ch...@christopherschultz.net
 : How much memory is in this thing?
 
 I have one with 700 MHz ARM1176JZ, 512MB RAM (model B). By
 the way it is working pretty nice :) I tried just to figure
 it out why only tomcat7 consumes some CPU when all other
 services are at 0%.
 
 Can you get a shell running on it? If so, take thread dumps of the
 JVM process: that will tell you (or us) what's going on.
 
 You can adjust the background thread's timing, but it's pretty
 innocuous.
 
 -chris
 
 -

 
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 
-BEGIN PGP SIGNATURE-
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJU8KRjAAoJEBzwKT+lPKRY41QP/1/pu4TGNkXTx82g08vWG/zL
nGccJgD9+G2sM2YGR17l6XcCwlZ28LfGwSid6Ub3lezLXMwl6Au4fRt8smdMv9jO
7tEO/naBxbIDLW3wtzwN1ttpgoF9TPsfk8XGuCYLeAq/p+qC9yEyl/OC5yP0ybnj
bAVBB41KHx5FVT/+GxyIBArSxE+7DxbCLpLPndr2jLxJvJKh4AbXWEOmNpAoJpHH
owi0iWKYbRf/ApADWarblCpflqob1mlkUNQRrz/ZEfbfgaYsQute7Qcz0xLtjT00
Z+gP9NjqWufZL9jIl9gI7IWs93e9oWK283LNHj52qHMtSonq9jx3h0OTCoCICGEq
w4mAErC1Hm8r9N069mo4XtJinnTGGNwC71a9akpKqyIQM7K500bDLze9+RvayVVr
Cbv8aOQMrvvM0no7Q8KGqgkm6KU1rp4bYFqAbOMzb57AE+lU7LCl/MUzxjCl75Ip
qm2i5NnW78NMRmeYpfD6p4ViEzRM7eaguUUyb1hSSD/g/tJM2VNeZ7BiXn+50VXF
RcsC5pmHw/mwW8aW2PN8IjwghzAX2TxI6EX37B1TCp8T4vEg8fjKxJ9cwr62UwHJ
35ObBalDumZlstGoRfPhpBHMJW8xnzKkWC0QWP5SQy0ZSDIad0Vvc1mMvEMn27n8
FFp0n7tv/mE5URaTjd8J
=i1lo
-END PGP SIGNATURE-

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



Re: when idle tomcat runs on 3.9% CPU

2015-02-27 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Chuck,

On 2/27/15 9:14 AM, Caldarale, Charles R wrote:
 From: Peter Irbizon [mailto:peterirbi...@gmail.com] Subject: Re:
 when idle tomcat runs on 3.9% CPU
 
 1. It is the latest Debian on Raspberry Pi (aka Raspbian).
 Hardware is Raspberry Pi.
 
 That would seem to fit Chris' postulation pretty much exactly:

It was David's postulation, but honestly... I'm impressed that someone
got Tomcat running on a Raspberry Pi. When I think Raspberry Pi, I
must admit that Java isn't the first solution that comes to mind.

How much memory is in this thing?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJU8IAOAAoJEBzwKT+lPKRYlhoP/1m1e1t5k9zJ0JeeyxZPn0tF
fY96sD9wTvbXcOGQyFh36roAdHSONkljc3JSmxEc/mBNowwRXBv1vAWYUexYwEal
Pbm7wblwpyIstTpJnV++RtoikIbSHmhXGi7CeVccCfIO0Exj+n4amXVMrztl8C8Z
Q5WEU1GJloUZffsCnTtqO51ivpX9FPuZxcpwbbxMhjhn2cBqrbfe7QlBWEKirTB7
zXazRMcWElwN8XUVtc1tZgq4qaSo7MDKZXvYTcnF2vz5HzNPiUZYAFF9TNdjk9mY
0CjKDQofuebuWopkXo30c6BvY4eY3OLrzLTjDait4mIM75Y7F5/Snku/979kJMSx
povLrQK19ZDTaibIRIXpbxmWArFUw6+Ty/XcDIo4NPX8y0bRXa04VePVD4fSTHII
t1vPrfFeMresQck42iqVhKoT/PaSVHIztAVNRMe6BF4g6mVK4D0IfMpVQ/m951Oy
TIJoFrbOlh5G0nzC5P6+Bc4UA3ovh+RETRUjNYwSv/YGgrxLAhiXH7KcjzAHnAcD
i6OoEc1k+xGZ8Xga7+5GrK23T94rvmR+fAow7UiYCM9P1UFRk/RCPkDsE5LMxYUE
sTi0QFFu4yA9BZHJEZM6myjXqF6RNyo5eDF32oB+4jaMcQ/nvLd5gbKCrjGAveQ6
PINQyLCGmoNUb+DPC8bC
=G3ec
-END PGP SIGNATURE-

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



RE: when idle tomcat runs on 3.9% CPU

2015-02-27 Thread Caldarale, Charles R
 From: Peter Irbizon [mailto:peterirbi...@gmail.com] 
 Subject: Re: when idle tomcat runs on 3.9% CPU

 1. It is the latest Debian on Raspberry Pi (aka Raspbian). Hardware is
 Raspberry Pi.

That would seem to fit Chris' postulation pretty much exactly:

  There is also the question of 3.9% of what?  If it's a slow, single core
  machine, it's a lot more likely that TC might use 3% of it, than it is if
  it's a 16-core 3.5GHz server.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


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



Re: when idle tomcat runs on 3.9% CPU

2015-02-27 Thread Peter Irbizon
Hello again, my answers to questions:
1. It is the latest Debian on Raspberry Pi (aka Raspbian). Hardware is
Raspberry Pi.
2. Maybe idle is not the best word in my case. Yes, app is deployed on
server but it is just for this: wait for incoming data over POST and the
save it to database. No traffic currently. (so it should not do anything
else)
Tomcat is 7. Apache Tomcat/7.0.28, JVM 1.7.0_25-b30
3. Profiler - I am newbie, but I will try to google it and run it.

I see always at least 3.9% CPU in top.

2015-02-24 16:34 GMT+01:00 David kerber dcker...@verizon.net:

 On 2/24/2015 10:16 AM, Christopher Schultz wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA256

 Daniel,

 On 2/24/15 8:01 AM, Daniel Mikusa wrote:

 On Tue, Feb 24, 2015 at 7:33 AM, Peter Irbizon
 peterirbi...@gmail.com wrote:

  Hello, I would like to know if it is normal that tomcat7 runs on
 3.9% CPU when idle? I saw all other processes are at 0%, only
 tomcat7 is always at least 3.9%.


 1.) What's your system like?  How many CPUs / cores?  Is it a VM or
 hardware?  What is the specific version of Tomcat?  of Java? What
 OS are you running?

 2.) How are you determining it's idle?  As John mention, do you
 have any apps deployed?  Do you know if traffic is hitting the
 server?

 3.) Can you run a profiler and attach it to Tomcat?  It'll tell
 you what's happening inside the JVM.


 4. Take a few thread dumps to see what the JVM threads are doing.

 When truly idle (i.e. no requests are being processed), Tomcat runs a
 maintenance thread that performs some background tasks, but that runs
 about once every 60 seconds and does very little, depending on what
 you have configured.

 So unless you are seeing that thread specifically running at its
 interval, Tomcat's threads are totally blocked waiting on various
 events to occur (like an I/O event for an incoming request, or waiting
 for a timeout to perform that maintenance).

 On a dev server, I just checked and my Tomcat processes go down to 0.0
 CPU as measured by top when they aren't doing anything.


 There is also the question of 3.9% of what?  If it's a slow, single core
 machine, it's a lot more likely that TC might use 3% of it, than it is if
 it's a 16-core 3.5GHz server.



 The thread dumps will likely tell the story.

 - -chris




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




Re: when idle tomcat runs on 3.9% CPU

2015-02-27 Thread Антон Мацюк
2015-02-27 16:32 GMT+02:00 Christopher Schultz ch...@christopherschultz.net:
 How much memory is in this thing?

It varies, 256MB or 512MB for model B, if I remember it right.
Have one serving DHCP at home :)

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



Re: when idle tomcat runs on 3.9% CPU

2015-02-27 Thread David kerber

On 2/27/2015 9:14 AM, Caldarale, Charles R wrote:

From: Peter Irbizon [mailto:peterirbi...@gmail.com]
Subject: Re: when idle tomcat runs on 3.9% CPU



1. It is the latest Debian on Raspberry Pi (aka Raspbian). Hardware is
Raspberry Pi.


That would seem to fit Chris' postulation pretty much exactly:


There is also the question of 3.9% of what?  If it's a slow, single core
machine, it's a lot more likely that TC might use 3% of it, than it is if
it's a 16-core 3.5GHz server.


Yup.  That's probably what the background listening threads take on that 
hardware and OS combination.  Also consider that the OS probably hasn't 
had the amount of optimization on RP that it has on desktop or server 
hardware.



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



Re: when idle tomcat runs on 3.9% CPU

2015-02-27 Thread Peter Irbizon
2015-02-27 16:32 GMT+02:00 Christopher Schultz ch...@christopherschultz.net
:
 How much memory is in this thing?

I have one with 700 MHz ARM1176JZ, 512MB RAM (model B). By the way it is
working pretty nice :) I tried just to figure it out why only tomcat7
consumes some CPU when all other services are at 0%.


Re: when idle tomcat runs on 3.9% CPU

2015-02-27 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Peter,

On 2/27/15 10:41 AM, Peter Irbizon wrote:
 2015-02-27 16:32 GMT+02:00 Christopher Schultz
 ch...@christopherschultz.net
 : How much memory is in this thing?
 
 I have one with 700 MHz ARM1176JZ, 512MB RAM (model B). By the way
 it is working pretty nice :) I tried just to figure it out why only
 tomcat7 consumes some CPU when all other services are at 0%.

Can you get a shell running on it? If so, take thread dumps of the JVM
process: that will tell you (or us) what's going on.

You can adjust the background thread's timing, but it's pretty innocuous.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJU8JFyAAoJEBzwKT+lPKRY9SMP/RV6RlUThwVDqRngMto/vPn9
3iwgANTuK7WKCV0RCVFbLoC17+GL4h7fCEl18GTwKSJf0k76MsrYPhrVQrgzTstd
ylDK0gPYgLVWHwmBKJjMsi/KYlKdfNjPeSgVqALrzJXk/gNHrrVOandRnYXePRN/
JGfk/6/KeXvWRk3nvOsx2VfVsKKeghBj4ED9l52E/EvOxhXcMQBHPJHs5vWPa3GA
jqIL1DUID/Q1dx3G3hthXROLAmHZVXPqD+tZ7Z1NjTFPJPc9+s8Rg8+tnqwph5fG
osPuq3Qx4XXVSbYzuGoFxH+DdiR4LEP+KU7H/3TuhR5tTV4dEzgU93KYJsszUkCw
eofe1XTPZj+dgmzAMircBbi8M5aeaRFHqC8s8V/Rbk8KJ84TDKqP0TzBh0N08by5
bAr9vCGOO9t9+Sbs+RdZCAHDoJz0UKKERWP++NxpeRVtYc5G07eeBdQBGVJ0Rk7I
WPvyrzBsr225RBiDyBf8/xDWLqgSA+Rn6TX2g+U5R0+fw3ssnQfzqRRUfeyckpth
wvvWCMn2neT/KtqqUIBVTV9q/OMgeHVjo7bY7iI6vo+k22Q4zoaxeGJ7g3OQwA0p
8xeTZ4jvsGmLz2U6der2fmXAn8K1y40oxM1gR2Yocm9Z7p19XLGquU4m2QTJ655L
rx3sGgP20Y2OsTlMiQMV
=poQC
-END PGP SIGNATURE-

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



Re: when idle tomcat runs on 3.9% CPU

2015-02-27 Thread Peter Irbizon
Hi Chris,
here are my dumps http://www.filedropper.com/jvmthreaddump. It looks like
it has something to do with memcached.

2015-02-27 16:46 GMT+01:00 Christopher Schultz ch...@christopherschultz.net
:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA256

 Peter,

 On 2/27/15 10:41 AM, Peter Irbizon wrote:
  2015-02-27 16:32 GMT+02:00 Christopher Schultz
  ch...@christopherschultz.net
  : How much memory is in this thing?
 
  I have one with 700 MHz ARM1176JZ, 512MB RAM (model B). By the way
  it is working pretty nice :) I tried just to figure it out why only
  tomcat7 consumes some CPU when all other services are at 0%.

 Can you get a shell running on it? If so, take thread dumps of the JVM
 process: that will tell you (or us) what's going on.

 You can adjust the background thread's timing, but it's pretty innocuous.

 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1
 Comment: GPGTools - http://gpgtools.org

 iQIcBAEBCAAGBQJU8JFyAAoJEBzwKT+lPKRY9SMP/RV6RlUThwVDqRngMto/vPn9
 3iwgANTuK7WKCV0RCVFbLoC17+GL4h7fCEl18GTwKSJf0k76MsrYPhrVQrgzTstd
 ylDK0gPYgLVWHwmBKJjMsi/KYlKdfNjPeSgVqALrzJXk/gNHrrVOandRnYXePRN/
 JGfk/6/KeXvWRk3nvOsx2VfVsKKeghBj4ED9l52E/EvOxhXcMQBHPJHs5vWPa3GA
 jqIL1DUID/Q1dx3G3hthXROLAmHZVXPqD+tZ7Z1NjTFPJPc9+s8Rg8+tnqwph5fG
 osPuq3Qx4XXVSbYzuGoFxH+DdiR4LEP+KU7H/3TuhR5tTV4dEzgU93KYJsszUkCw
 eofe1XTPZj+dgmzAMircBbi8M5aeaRFHqC8s8V/Rbk8KJ84TDKqP0TzBh0N08by5
 bAr9vCGOO9t9+Sbs+RdZCAHDoJz0UKKERWP++NxpeRVtYc5G07eeBdQBGVJ0Rk7I
 WPvyrzBsr225RBiDyBf8/xDWLqgSA+Rn6TX2g+U5R0+fw3ssnQfzqRRUfeyckpth
 wvvWCMn2neT/KtqqUIBVTV9q/OMgeHVjo7bY7iI6vo+k22Q4zoaxeGJ7g3OQwA0p
 8xeTZ4jvsGmLz2U6der2fmXAn8K1y40oxM1gR2Yocm9Z7p19XLGquU4m2QTJ655L
 rx3sGgP20Y2OsTlMiQMV
 =poQC
 -END PGP SIGNATURE-

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




Re: when idle tomcat runs on 3.9% CPU

2015-02-24 Thread John D. Ament
When you say idle, is there an application deployed to tomcat, or is it
just the bare app server with nothing deployed?

On Tue Feb 24 2015 at 7:35:31 AM Peter Irbizon peterirbi...@gmail.com
wrote:

 Hello,
 I would like to know if it is normal that tomcat7 runs on 3.9% CPU when
 idle? I saw all other processes are at 0%, only tomcat7 is always at least
 3.9%.



when idle tomcat runs on 3.9% CPU

2015-02-24 Thread Peter Irbizon
Hello,
I would like to know if it is normal that tomcat7 runs on 3.9% CPU when
idle? I saw all other processes are at 0%, only tomcat7 is always at least
3.9%.


Re: when idle tomcat runs on 3.9% CPU

2015-02-24 Thread Daniel Mikusa
On Tue, Feb 24, 2015 at 7:33 AM, Peter Irbizon peterirbi...@gmail.com
wrote:

 Hello,
 I would like to know if it is normal that tomcat7 runs on 3.9% CPU when
 idle? I saw all other processes are at 0%, only tomcat7 is always at least
 3.9%.


1.) What's your system like?  How many CPUs / cores?  Is it a VM or
hardware?  What is the specific version of Tomcat?  of Java?  What OS are
you running?

2.) How are you determining it's idle?  As John mention, do you have any
apps deployed?  Do you know if traffic is hitting the server?

3.) Can you run a profiler and attach it to Tomcat?  It'll tell you what's
happening inside the JVM.

Dan


Re: when idle tomcat runs on 3.9% CPU

2015-02-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Daniel,

On 2/24/15 8:01 AM, Daniel Mikusa wrote:
 On Tue, Feb 24, 2015 at 7:33 AM, Peter Irbizon 
 peterirbi...@gmail.com wrote:
 
 Hello, I would like to know if it is normal that tomcat7 runs on 
 3.9% CPU when idle? I saw all other processes are at 0%, only 
 tomcat7 is always at least 3.9%.
 
 
 1.) What's your system like?  How many CPUs / cores?  Is it a VM or
 hardware?  What is the specific version of Tomcat?  of Java? What
 OS are you running?
 
 2.) How are you determining it's idle?  As John mention, do you 
 have any apps deployed?  Do you know if traffic is hitting the 
 server?
 
 3.) Can you run a profiler and attach it to Tomcat?  It'll tell
 you what's happening inside the JVM.

4. Take a few thread dumps to see what the JVM threads are doing.

When truly idle (i.e. no requests are being processed), Tomcat runs a
maintenance thread that performs some background tasks, but that runs
about once every 60 seconds and does very little, depending on what
you have configured.

So unless you are seeing that thread specifically running at its
interval, Tomcat's threads are totally blocked waiting on various
events to occur (like an I/O event for an incoming request, or waiting
for a timeout to perform that maintenance).

On a dev server, I just checked and my Tomcat processes go down to 0.0
CPU as measured by top when they aren't doing anything.

The thread dumps will likely tell the story.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJU7JXcAAoJEBzwKT+lPKRYbpoP/iEYzgNjKkAXyvo907sJe6vY
0gVe3qLlZiuQGQLnlXHxTOTP701+IxK+3TzQN6jO2+dCNAZkJvup+xOzRLUavHk2
fNMYUgsPdCugg9S64Vfx7Mmo7Id9zX9UZ49yg+cwWAp7OAYaGfB6QIY/ux6C0zxB
/ELOjGvyE1gHrenhovtVptze4JBBOzpsa2AMl1bnz4mtfVk5p8+21VI7u5e3gfRU
4lE5tNsjekWXnxUVwg4FNzDuIY2KP2Wqq7sNE6QSKhoIltuT+DB0g8u71ARQzkJH
atMNuu7lG0auZqUQRhUxtCJ/6DIshHNxKlhCT91AjF9Mc3rdNSadTd7/j3DslCcL
0TnhdznXPou5LJgYNmdW4AVD6FQqxEf+0JW7o8jq4bbJ3NYlDVjhFoFMskN7IsOD
h6uDzvS3nLrYuKJjsBNQWBRloMNtiy/fIa37AZeXrl81CubSgDPO3kYJs3fzjs9j
srLvGEoctaHHA8N6ZWI+PL4r2vgLhu5iRY4Hh6OHHQ8zpnzKO1vWbqw0oFD44TQ6
tnuPyEwclm44tdAonAxmAyRLxpACVdjBp2hMbZq8YvcetCi/XvuRs3nhp5NpIZnE
QHxEk2BpCGWoQxGTkLuEtj+vf/EwqAUyk+qLXV04lo29KcO4maxh4HYYViM/rSgb
rC5Fm3UhC3vhkxwRE8/e
=Wts6
-END PGP SIGNATURE-

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



Re: when idle tomcat runs on 3.9% CPU

2015-02-24 Thread David kerber

On 2/24/2015 10:16 AM, Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Daniel,

On 2/24/15 8:01 AM, Daniel Mikusa wrote:

On Tue, Feb 24, 2015 at 7:33 AM, Peter Irbizon
peterirbi...@gmail.com wrote:


Hello, I would like to know if it is normal that tomcat7 runs on
3.9% CPU when idle? I saw all other processes are at 0%, only
tomcat7 is always at least 3.9%.



1.) What's your system like?  How many CPUs / cores?  Is it a VM or
hardware?  What is the specific version of Tomcat?  of Java? What
OS are you running?

2.) How are you determining it's idle?  As John mention, do you
have any apps deployed?  Do you know if traffic is hitting the
server?

3.) Can you run a profiler and attach it to Tomcat?  It'll tell
you what's happening inside the JVM.


4. Take a few thread dumps to see what the JVM threads are doing.

When truly idle (i.e. no requests are being processed), Tomcat runs a
maintenance thread that performs some background tasks, but that runs
about once every 60 seconds and does very little, depending on what
you have configured.

So unless you are seeing that thread specifically running at its
interval, Tomcat's threads are totally blocked waiting on various
events to occur (like an I/O event for an incoming request, or waiting
for a timeout to perform that maintenance).

On a dev server, I just checked and my Tomcat processes go down to 0.0
CPU as measured by top when they aren't doing anything.


There is also the question of 3.9% of what?  If it's a slow, single 
core machine, it's a lot more likely that TC might use 3% of it, than it 
is if it's a 16-core 3.5GHz server.





The thread dumps will likely tell the story.

- -chris




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