You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Lucas Vickers <lu...@gmail.com> on 2009/07/13 20:22:53 UTC
Logging of memory / thread activity
Hello,
I have an issue where Tomcat shuts down without reason. When receiving a
light to moderate load that involves MySql database work tomcat shuts down
without error.
I get the message
"INFO main org.apache.coyote.http11. Http11BaseProtocol - Pausing Coyote
HTTP/1.1 on http-8080"
This is consistent after 2-4 minutes of simple stress testing.
I am not very sure where the issue lies. I am aware of profilers (which I
will eventually use) but for now I would like some way of logging Tomcat
vitals so I can see if something is spiking (memory use, thread use, etc).
I know the tomcat status page gives me a good deal of the information I
would like. Is there any product / methodology for periodically logging
this information?
I am using:
Java: 1.6.0_14-b08
Tomcat: 5.5.25
OS: Linux 2.6.18-028stab060.8
Regards,
Lucas
Re: Tuniing Apache-Tomcap
Posted by Pid <p...@pidster.com>.
On 13/7/09 20:57, Vida Luz Arista wrote:
> Hi All
>
> We have a application running on Apache Tomcat, but the performance is very slow, the application was developer in netbeans, but now is runing in the server is very slow.
Which versions of: Tomcat, OS?
How much memory on your dev machine, how much on the server?
Using a DB? Which one?
Using a web server? Which one?
If applicable, are all or any of the above on the same box?
If applicable, what resources are each of the above using?
What are your heap settings?
What does your GC log say?
I can probably think of some more questions, but these'll keep you going
for a bit.
> We need suggestion to make tuning en the apache tomcat.
How do you know that Tomcat is the source of the problem?
p
> Regards.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Tuniing Apache-Tomcap
Posted by Vida Luz Arista <vi...@ideay.net.ni>.
Hi All
We have a application running on Apache Tomcat, but the performance is very slow, the application was developer in netbeans, but now is runing in the server is very slow.
We need suggestion to make tuning en the apache tomcat.
Regards.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Logging of memory / thread activity
Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Lucas,
On 7/13/2009 2:22 PM, Lucas Vickers wrote:
> I have an issue where Tomcat shuts down without reason. When receiving a
> light to moderate load that involves MySql database work tomcat shuts down
> without error.
>
> I get the message
> "INFO main org.apache.coyote.http11. Http11BaseProtocol - Pausing Coyote
> HTTP/1.1 on http-8080"
>
> This is consistent after 2-4 minutes of simple stress testing.
What happens if you don't even stress-test the app? Does Tomcat go down
with /no/ load on it?
> I am not very sure where the issue lies.
Try this:
$ grep System.exit `find src -name "*.java"`
> I know the tomcat status page gives me a good deal of the information I
> would like. Is there any product / methodology for periodically logging
> this information?
I would write a script that does roughly this:
while true ; do
wget -O status.`date` http://localhost/path/to/tomcat/status
sleep 1000
done
Then you can see a history of the statuses of your server. If some
thread is calling System.exit, though, then you probably won't see
anything useful.
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkpbkEgACgkQ9CaO5/Lv0PBkGQCgqBtEM50zA0adK0aTdLLnR5kv
82UAn2ZCgDJWKZOUlulYL7Tl8xETXSDD
=6YP5
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Logging of memory / thread activity
Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Lucas,
On 7/15/2009 10:07 AM, Lucas Vickers wrote:
> Upon investigation and reading
>
> http://opensource.atlassian.com/confluence/spring/pages/viewpage.action?pageId=2669
>
> Perhaps I need to deregister my database driver. I thought the database
> driver would be released when i explicitly close the statement and
> connection.
I don't think that failing to deregister your driver would bring-down
your Tomcat instance. Something else must be going on.
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkpd6gIACgkQ9CaO5/Lv0PDQUQCeKgnc2SSaRjwQbev01FEPf6MA
dRYAn06cu1nqZEY7i0HaQIdllW4jdg4c
=C9dU
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Logging of memory / thread activity
Posted by Lucas Vickers <lu...@gmail.com>.
Upon investigation and reading
http://opensource.atlassian.com/confluence/spring/pages/viewpage.action?pageId=2669
Perhaps I need to deregister my database driver. I thought the database
driver would be released when i explicitly close the statement and
connection.
I do not fully understand why I would need a separate listener to deregister
my driver, shouldn't I be able to do this inside my servlet? I guess DB
pooling would fix this issue, but I should know how to do it in my java
code.
thanks
On Wed, Jul 15, 2009 at 9:35 AM, Lucas Vickers <lu...@gmail.com>wrote:
> Grepping all my java code for "System.exit" returns blank. This is not
> surprising as I am the only user on this box.
>
> I went and changed the shutdown keyword in server.xml (won't make a
> difference, and didn't make a difference)
>
> The unknown shutdown only occurs when I am doing database access. So far I
> have only tested it on an update query, not a simple select query. I stress
> tested the same setup with a simple HelloWorld servlet and it ran without
> issue.
> The database setup is as follows:
>
> Java: 1.6.0_14-b08
> Tomcat: 5.5.25
> OS: Linux 2.6.18-028stab060.8
> MySql: 5.0.81
>
> I do not have database pooling. I have tried both these drivers:
> - com.mysql.jdbc.Driver
> - org.gjt.mm.mysql.Driver
>
> Currently I am using: com.mysql.jdbc.Driver
>
>
> I have added
> -Xloggc:../logs/java_gc.out
> -verbose:gc
>
> and successfully caused my server to restart after 2 minutes.
>
> The java GC logs are attached. The memory usage appears to increase but
> not anything insane.
> I am running on a dedicated virtual host, I have 512 dedicated ram and can
> burst to 1gig.
>
> I've attached 3 java crash logs (.crash1.txt - .crash3.txt). They all
> appear to crash around the time when memory hits 200-250 MB
> My server java memory args are:
> -Xms384M -Xmx1024M
> So I do not get where 250 would come into play.
>
> For kicks I stress tested the helloworld app again using the GC logging and
> it never gets above 70 megs, so obviously the database connectivity is
> causing issues.
>
> Perhaps DB pooling is worth my time, but I do not think it would help the
> original issue I was trying to solve. I started stress testing this server
> because it was restarting after 10 min doing a demo that requires
> connections once every 2 seconds. For kicks I decided to replicate this. I
> took my stress test app (which is just a loop that HTTP POST 's data to be
> written to the db) and put a 2 second pause in there. The setup is not
> identical to what was causing issues before (I have removed geoserver to
> determine if that was causing the issue), but the result is the same. I ran
> 2 test clients in a loop (delay every 2 seconds, so it's about a db update
> once a second) and it took longer but I was able to get tomcat to restart.
> The log for this instance is (java_gc_out.slow_crash.txt). This crash
> occurred when we hit around 200megs of memory.
> If I had to guess I am leaving open database connections or leaking db
> memory, but upon reviewing my code I do not see how this could be. I've
> attached the simple servlet for reference. I am not using database pooling
> in the servlet and the database definitions in web.xml and context.xml have
> been commented out.
>
> With such a simple task as a db update every 1-2 seconds, why is the memory
> continually increasing?
>
> What else should I be looking into? I suppose I should monitor how many
> threads are created.
> Again I grepped the logs and tomcat puts out no WARN or ERROR information,
> only an INFO statement that it's pausing cayote.
>
> Thanks guys
> Lucas
>
>
>
>
> On Mon, Jul 13, 2009 at 4:49 PM, János Löbb <ja...@yale.edu> wrote:
>
>>
>> On Jul 13, 2009, at 3:47 PM, Caldarale, Charles R wrote:
>>
>> From: Lucas Vickers [mailto:lucasvickers@gmail.com]
>>>> Subject: Logging of memory / thread activity
>>>>
>>>> I have an issue where Tomcat shuts down without reason.
>>>>
>>>
>>> So this is in some universe without causality? Must be quantum effects.
>>>
>>
>> Someone replaced Schrödinger's cat with tomcat in a "gedanke" experiment
>> :)
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>
Re: Logging of memory / thread activity
Posted by János Löbb <ja...@yale.edu>.
On Jul 13, 2009, at 3:47 PM, Caldarale, Charles R wrote:
>> From: Lucas Vickers [mailto:lucasvickers@gmail.com]
>> Subject: Logging of memory / thread activity
>>
>> I have an issue where Tomcat shuts down without reason.
>
> So this is in some universe without causality? Must be quantum
> effects.
Someone replaced Schrödinger's cat with tomcat in a "gedanke"
experiment :)
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Logging of memory / thread activity
Posted by Lucas Vickers <lu...@gmail.com>.
well, tomcat shows no logged errors :) There is a reason, I just have not
yet figured it out.
I will take a look, thank you!
On Mon, Jul 13, 2009 at 3:47 PM, Caldarale, Charles R <
Chuck.Caldarale@unisys.com> wrote:
> > From: Lucas Vickers [mailto:lucasvickers@gmail.com]
> > Subject: Logging of memory / thread activity
> >
> > I have an issue where Tomcat shuts down without reason.
>
> So this is in some universe without causality? Must be quantum effects.
>
> > Is there any product / methodology for periodically
> > logging this information?
>
> You can take a look this:
> http://moskito.anotheria.net/
>
> You probably should also turn on -verbose:gc and -Xloggc to monitor
> activity on the Java heap.
>
> - 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-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
RE: Logging of memory / thread activity
Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Lucas Vickers [mailto:lucasvickers@gmail.com]
> Subject: Logging of memory / thread activity
>
> I have an issue where Tomcat shuts down without reason.
So this is in some universe without causality? Must be quantum effects.
> Is there any product / methodology for periodically
> logging this information?
You can take a look this:
http://moskito.anotheria.net/
You probably should also turn on -verbose:gc and -Xloggc to monitor activity on the Java heap.
- 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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org