You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Chris Haskins <ch...@apakgroup.com> on 2003/11/12 15:05:49 UTC
Rouge tomcat processes
Hi,
We have a problem in that tomcat processes are taking up 100% CPU. We're
just upgraded the JVM to jdk1.4.2_02 to try and fix this, as per the FAQ
at apache.org and this hasn't changed anything. We don't know what is
causing this and wondered if there is any way to match the pid's with
Tomcat session id's so we can look through the logs to investigate what
might have caused this?
Thanks
Chris
**********************************************************************
The information contained in this message or any of its attachments may
be privileged and confidential and intended for the exclusive use of the
addressee. The views expressed may not be APAK policy but the personal
views of the originator. If you have received this message in error, please
advise the sender immediately by reply e-mail and delete this message and
any attachments without retaining a copy. This footnote also confirms that
this email message has been swept for the presence of known computer
viruses before being sent.
**********************************************************************
Re: How to tune Tomcat and Java?
Posted by Christoph Gaffga <cg...@triplemind.com>.
> Compaq ProLiant 6000, 2 x PII Xeon 400MHz, 1,3GB RAM
Why not using a dual Xeon 2.8, they become quite cheap.
Christoph
P.S.: As I see in my setup java uses all available processors.
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
RE: How to tune Tomcat and Java?
Posted by Peter Guyatt <pg...@telesoft-technologies.com>.
Hi There,
Java and Tomcat are both multi-threaded applications. So they are both
using more than one CPU.
If it is using 50% of one processor then it is using 100% CPU on that
processor, since its 50% of the actual processing capacity.
Thanks
Pete
-----Original Message-----
From: Jens Ove Lillegraven [mailto:Jens.Ove.Lillegraven@itdrift.no]
Sent: 12 November 2003 15:17
To: tomcat-user@jakarta.apache.org
Subject: How to tune Tomcat and Java?
Hi,
We have a problem in that the Tomcat (java) process is the bottleneck and is
using only one CPU.
There will be high load on the server when it is put online, so we are
stress testing it offline now. Using the top command in Linux during the
stress test, it seems that java is the bottleneck of the system. But it uses
not 100%, but about 45-50% of one CPU. We get no http error, the page
performance (pages pr. second) is just getting worse as we put on more
stress load. The max memory consumption is set to 300M, but I've never seen
java using more than 111M. I suppose the throughput would have increased if
both CPUs could be used, but is Java (Tomcat) a single processor
application? The network throughput has a maximum average of 500kbps
(kilo-bits) during the stress test, and should manage much more.
Anyone who know how to make java and Tomcat performing better?
Details of hardware and innstalled applications:
Compaq ProLiant 6000, 2 x PII Xeon 400MHz, 1,3GB RAM
Red Hat Linux Enterprise 3 ES
J2EE: j2sdkee-1_3_1-linux
J2SE: j2sdk-1_4_2_02-linux-i586
Tomcat: 4.1.24
MySQL: 4.0.16
Tuning Tomcat memory (done):
in /usr/bin/dtomcat4:
CATALINA_OPTS="-Xmx300M -Xms100M $CATALINA_OPTS $JPDA_OPTS"
MySQL has been tuned, and is running very well.
Thanks
Jens Ove
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: How to tune Tomcat and Java?
Posted by Trinity Jacobs <tr...@yahoo.com>.
PLEASE GET THE FUCK OUT OF MY INBOX. I HAVE HAD ENOUGH. 600 EMAILS A DAY . GET ME OFF YOUR FUCKING LIST.
love- trin jacobs.
---------------------------------
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
Re: How to tune Tomcat and Java?
Posted by Jens Ove Lillegraven <Je...@itdrift.no>.
Thanks for reply!
Got it! To show all threads, type H in top in Linux. Then we see that java
is multi-threaded, and uses all CPUs.
But still, Tomcat and java seems to be the bottleneck in our system. I tried
to make java use more memory, but with no luck.
I tried with:
in /usr/bin/dtomcat4:
CATALINA_OPTS="-Xmx300M -Xms100M $CATALINA_OPTS $JPDA_OPTS"
But this made no difference to the memory consumption or the performance.
When starting Tomcat, it uses less than 100M. MySQL uses only a fraction of
CPU compared with java, and there are several SQL queries in every page of
the web publishing system.
Is there any way to increase the preformance of Tomcat and java without
tuning the application (=the Java Server Pages)?
Thanks.
Jens Ove
----- Original Message -----
From: "Frode E. Moe" <fr...@coretrek.no>
To: "Tomcat Users List" <to...@jakarta.apache.org>; "Jens Ove
Lillegraven" <Je...@itdrift.no>
Sent: Thursday, November 13, 2003 3:27 PM
Subject: Re: How to tune Tomcat and Java?
> On Thu, Nov 13, 2003 at 15:17:53 +0100, Jens Ove Lillegraven wrote:
> > As you see, there's only one Java service on CPU 0, and MySQL is running
on both CPUs.
> > Any explanation for this?
>
> Apparently RedHat Linux 8.0 and above only shows the main thread by
> default.
>
> See
http://www.redhat.com/docs/manuals/linux/RHL-8.0-Manual/release-notes/x86/
>
> If you use "ps -m", all threads should be displayed.
>
> (I'm currently on a Debian machine, so I can't confirm if this works)
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: How to tune Tomcat and Java?
Posted by "Frode E. Moe" <fr...@coretrek.no>.
On Thu, Nov 13, 2003 at 15:17:53 +0100, Jens Ove Lillegraven wrote:
> As you see, there's only one Java service on CPU 0, and MySQL is running on both CPUs.
> Any explanation for this?
Apparently RedHat Linux 8.0 and above only shows the main thread by
default.
See http://www.redhat.com/docs/manuals/linux/RHL-8.0-Manual/release-notes/x86/
If you use "ps -m", all threads should be displayed.
(I'm currently on a Debian machine, so I can't confirm if this works)
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: How to tune Tomcat and Java?
Posted by Jens Ove Lillegraven <Je...@itdrift.no>.
Hi!
Thanks for your reply!
If Java and Tomcat is multi-threaded applications, I still don't understand why I see Java on only one CPU when I use the top function in Linux. Here is a snapshot from a medium stress-test load:
15:02:23 up 1 day, 22:23, 1 user, load average: 1,79, 1,56, 0,74
82 processes: 76 sleeping, 5 running, 1 zombie, 0 stopped
CPU states: cpu user nice system irq softirq iowait idle
total 50,0% 0,0% 7,4% 0,0% 4,6% 0,5% 37,2%
cpu00 31,9% 0,0% 8,9% 0,0% 5,9% 1,1% 51,9%
cpu01 68,1% 0,0% 5,9% 0,0% 3,3% 0,0% 22,5%
Mem: 1286812k av, 887436k used, 399376k free, 0k shrd, 162608k buff
462864k actv, 193060k in_d, 256k in_c
Swap: 3072216k av, 0k used, 3072216k free 392952k cached
PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND
745 root 25 0 98,4M 98M 7400 S 42,7 7,8 158:48 0 java
6048 mysql 15 0 101M 101M 2576 S 0,9 8,0 1:12 1 mysqld
6049 mysql 25 0 101M 101M 2576 R 0,6 8,0 1:49 1 mysqld
13138 root 15 0 1292 1292 904 R 0,3 0,1 0:03 0 top
6400 mysql 25 0 101M 101M 2576 S 0,1 8,0 0:00 0 mysqld
6410 mysql 25 0 101M 101M 2576 S 0,1 8,0 0:00 0 mysqld
6528 mysql 25 0 101M 101M 2576 S 0,1 8,0 0:00 0 mysqld
1 root 15 0 500 500 444 S 0,0 0,0 0:08 0 init
2 root RT 0 0 0 0 SW 0,0 0,0 0:00 0 migration/0
3 root RT 0 0 0 0 SW 0,0 0,0 0:00 1 migration/1
4 root 15 0 0 0 0 SW 0,0 0,0 0:00 0 keventd
5 root 34 19 0 0 0 SWN 0,0 0,0 0:00 0 ksoftirqd/0
6 root 34 19 0 0 0 SWN 0,0 0,0 0:00 1 ksoftirqd/1
9 root 25 0 0 0 0 SW 0,0 0,0 0:00 0 bdflush
7 root 15 0 0 0 0 SW 0,0 0,0 0:02 0 kswapd
8 root 15 0 0 0 0 SW 0,0 0,0 0:03 0 kscand
10 root 15 0 0 0 0 SW 0,0 0,0 0:04 0 kupdated
11 root 25 0 0 0 0 SW 0,0 0,0 0:00 0 mdrecoveryd
20 root 15 0 0 0 0 SW 0,0 0,0 0:01 0 kjournald
75 root 25 0 0 0 0 SW 0,0 0,0 0:00 1 khubd
145 root 15 0 0 0 0 SW 0,0 0,0 0:05 1 kjournald
146 root 15 0 0 0 0 SW 0,0 0,0 0:00 0 kjournald
147 root 15 0 0 0 0 SW 0,0 0,0 0:11 0 kjournald
148 root 15 0 0 0 0 SW 0,0 0,0 0:02 1 kjournald
492 root 15 0 568 568 492 S 0,0 0,0 0:00 1 syslogd
496 root 25 0 448 448 392 S 0,0 0,0 0:00 0 klogd
506 root 15 0 444 444 384 S 0,0 0,0 0:23 1 irqbalance
523 rpc 25 0 560 560 488 S 0,0 0,0 0:00 0 portmap
542 rpcuser 25 0 716 716 636 S 0,0 0,0 0:00 0 rpc.statd
622 root 15 0 1460 1460 1228 S 0,0 0,1 0:02 0 sshd
636 root 25 0 792 792 684 S 0,0 0,0 0:00 1 xinetd
646 root 15 0 488 488 408 S 0,0 0,0 0:00 0 vsftpd
667 root 15 0 2584 2584 1892 S 0,0 0,2 0:07 0 sendmail
676 smmsp 15 0 2260 2252 1708 S 0,0 0,1 0:00 1 sendmail
754 root 15 0 464 464 408 S 0,0 0,0 0:00 0 gpm
763 root 15 0 612 612 544 S 0,0 0,0 0:00 0 crond
806 daemon 15 0 556 556 492 S 0,0 0,0 0:00 0 atd
842 root 15 0 4972 4972 1900 S 0,0 0,3 0:07 1 miniserv.pl
846 root 15 0 416 416 368 S 0,0 0,0 0:00 1 mingetty
847 root 15 0 420 420 368 S 0,0 0,0 0:00 0 mingetty
848 root 15 0 420 420 368 S 0,0 0,0 0:00 1 mingetty
849 root 21 0 420 420 368 S 0,0 0,0 0:00 0 mingetty
850 root 17 0 420 420 368 S 0,0 0,0 0:00 1 mingetty
851 root 17 0 416 416 368 S 0,0 0,0 0:00 1 mingetty
6018 root 25 0 1128 1128 984 S 0,0 0,0 0:00 1 mysqld_safe
6050 mysql 20 0 101M 101M 2576 S 0,0 8,0 0:00 0 mysqld
6051 mysql 15 0 101M 101M 2576 S 0,0 8,0 0:00 0 mysqld
6052 mysql 15 0 101M 101M 2576 S 0,0 8,0 0:00 0 mysqld
6053 mysql 15 0 101M 101M 2576 S 0,0 8,0 0:10 0 mysqld
6054 mysql 15 0 101M 101M 2576 S 0,0 8,0 0:00 1 mysqld
6055 mysql 15 0 101M 101M 2576 S 0,0 8,0 1:17 1 mysqld
6056 mysql 15 0 101M 101M 2576 S 0,0 8,0 0:29 0 mysqld
6057 mysql 15 0 101M 101M 2576 S 0,0 8,0 0:09 1 mysqld
13091 root 15 0 2084 2084 1716 S 0,0 0,1 0:00 1 sshd
13093 root 23 0 1336 1336 1128 S 0,0 0,1 0:00 0 bash
6369 mysql 25 0 101M 101M 2576 S 0,0 8,0 0:00 1 mysqld
6385 mysql 25 0 101M 101M 2576 S 0,0 8,0 0:00 1 mysqld
As you see, there's only one Java service on CPU 0, and MySQL is running on both CPUs.
Any explanation for this?
The web application running is a web publishing system based on web contents stored in a MySQL database. So there's lots of SQL queries, but fron the info above, java seems to be the bottleneck in the system.
Any help to increase the performance is appreciated.
Thanks
Jens Ove
----- Original Message -----
From: "Peter Guyatt" <pg...@telesoft-technologies.com>
To: "Tomcat Users List" <to...@jakarta.apache.org>; "Jens Ove Lillegraven" <Je...@itdrift.no>
Sent: Wednesday, November 12, 2003 4:31 PM
Subject: RE: How to tune Tomcat and Java?
> Hi There
>
> sorry sent the last one before it was ready ;-)
>
> Java and Tomcat are both multi-threaded applications. So they are both
> using more than one CPU (if available).
>
> If it is using 50% of one processor then it is using 100% CPU on that
> processor, since its 50% of the actual processing capacity.
>
> Check for an infinate loop without a sleep in your code, especially if you
> are attempting to connect a client socket to a server since linux does not
> wait before throwing an exception.
>
> Thanks
>
> Pete
>
> -----Original Message-----
> From: Jens Ove Lillegraven [mailto:Jens.Ove.Lillegraven@itdrift.no]
> Sent: 12 November 2003 15:17
> To: tomcat-user@jakarta.apache.org
> Subject: How to tune Tomcat and Java?
>
>
> Hi,
>
> We have a problem in that the Tomcat (java) process is the bottleneck and is
> using only one CPU.
> There will be high load on the server when it is put online, so we are
> stress testing it offline now. Using the top command in Linux during the
> stress test, it seems that java is the bottleneck of the system. But it uses
> not 100%, but about 45-50% of one CPU. We get no http error, the page
> performance (pages pr. second) is just getting worse as we put on more
> stress load. The max memory consumption is set to 300M, but I've never seen
> java using more than 111M. I suppose the throughput would have increased if
> both CPUs could be used, but is Java (Tomcat) a single processor
> application? The network throughput has a maximum average of 500kbps
> (kilo-bits) during the stress test, and should manage much more.
> Anyone who know how to make java and Tomcat performing better?
>
> Details of hardware and innstalled applications:
> Compaq ProLiant 6000, 2 x PII Xeon 400MHz, 1,3GB RAM
> Red Hat Linux Enterprise 3 ES
> J2EE: j2sdkee-1_3_1-linux
> J2SE: j2sdk-1_4_2_02-linux-i586
> Tomcat: 4.1.24
> MySQL: 4.0.16
>
> Tuning Tomcat memory (done):
> in /usr/bin/dtomcat4:
> CATALINA_OPTS="-Xmx300M -Xms100M $CATALINA_OPTS $JPDA_OPTS"
>
> MySQL has been tuned, and is running very well.
>
> Thanks
> Jens Ove
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
RE: How to tune Tomcat and Java?
Posted by Peter Guyatt <pg...@telesoft-technologies.com>.
Hi There
sorry sent the last one before it was ready ;-)
Java and Tomcat are both multi-threaded applications. So they are both
using more than one CPU (if available).
If it is using 50% of one processor then it is using 100% CPU on that
processor, since its 50% of the actual processing capacity.
Check for an infinate loop without a sleep in your code, especially if you
are attempting to connect a client socket to a server since linux does not
wait before throwing an exception.
Thanks
Pete
-----Original Message-----
From: Jens Ove Lillegraven [mailto:Jens.Ove.Lillegraven@itdrift.no]
Sent: 12 November 2003 15:17
To: tomcat-user@jakarta.apache.org
Subject: How to tune Tomcat and Java?
Hi,
We have a problem in that the Tomcat (java) process is the bottleneck and is
using only one CPU.
There will be high load on the server when it is put online, so we are
stress testing it offline now. Using the top command in Linux during the
stress test, it seems that java is the bottleneck of the system. But it uses
not 100%, but about 45-50% of one CPU. We get no http error, the page
performance (pages pr. second) is just getting worse as we put on more
stress load. The max memory consumption is set to 300M, but I've never seen
java using more than 111M. I suppose the throughput would have increased if
both CPUs could be used, but is Java (Tomcat) a single processor
application? The network throughput has a maximum average of 500kbps
(kilo-bits) during the stress test, and should manage much more.
Anyone who know how to make java and Tomcat performing better?
Details of hardware and innstalled applications:
Compaq ProLiant 6000, 2 x PII Xeon 400MHz, 1,3GB RAM
Red Hat Linux Enterprise 3 ES
J2EE: j2sdkee-1_3_1-linux
J2SE: j2sdk-1_4_2_02-linux-i586
Tomcat: 4.1.24
MySQL: 4.0.16
Tuning Tomcat memory (done):
in /usr/bin/dtomcat4:
CATALINA_OPTS="-Xmx300M -Xms100M $CATALINA_OPTS $JPDA_OPTS"
MySQL has been tuned, and is running very well.
Thanks
Jens Ove
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
How to tune Tomcat and Java?
Posted by Jens Ove Lillegraven <Je...@itdrift.no>.
Hi,
We have a problem in that the Tomcat (java) process is the bottleneck and is
using only one CPU.
There will be high load on the server when it is put online, so we are
stress testing it offline now. Using the top command in Linux during the
stress test, it seems that java is the bottleneck of the system. But it uses
not 100%, but about 45-50% of one CPU. We get no http error, the page
performance (pages pr. second) is just getting worse as we put on more
stress load. The max memory consumption is set to 300M, but I've never seen
java using more than 111M. I suppose the throughput would have increased if
both CPUs could be used, but is Java (Tomcat) a single processor
application? The network throughput has a maximum average of 500kbps
(kilo-bits) during the stress test, and should manage much more.
Anyone who know how to make java and Tomcat performing better?
Details of hardware and innstalled applications:
Compaq ProLiant 6000, 2 x PII Xeon 400MHz, 1,3GB RAM
Red Hat Linux Enterprise 3 ES
J2EE: j2sdkee-1_3_1-linux
J2SE: j2sdk-1_4_2_02-linux-i586
Tomcat: 4.1.24
MySQL: 4.0.16
Tuning Tomcat memory (done):
in /usr/bin/dtomcat4:
CATALINA_OPTS="-Xmx300M -Xms100M $CATALINA_OPTS $JPDA_OPTS"
MySQL has been tuned, and is running very well.
Thanks
Jens Ove
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: Rouge tomcat processes
Posted by Tim Funk <fu...@joedog.org>.
Nope. Your best chance is to perform some thread dumps. (Google on how to do
a thread dump)
From the thread dumps get some when things are good, and multiple ones when
things are bad. With luck your see a pattern in the dumps.
You'll notice a lot of stuff waiting and sleeping that have similar traces,
you can ignore those since those are probably workers waiting for work.
-Tim
Chris Haskins wrote:
> Hi,
>
> We have a problem in that tomcat processes are taking up 100% CPU. We're
> just upgraded the JVM to jdk1.4.2_02 to try and fix this, as per the FAQ
> at apache.org and this hasn't changed anything. We don't know what is
> causing this and wondered if there is any way to match the pid's with
> Tomcat session id's so we can look through the logs to investigate what
> might have caused this?
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org