You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by murthy gandikota <mu...@yahoo.com> on 2008/04/22 17:01:20 UTC

Why does Tomcat become slow during weekends?

We have a website based on embedded Tomcat with Jboss 4.0.2. We noticed that every weekend the Tomcat becomes sluggish. I mean there are no errors like HTTP404. The website simply hangs. We theorized that JVM is busy with garbage collection. Is that realistic? Does anyone have any other suggestions?
   
  Thanks
  Murthy

       
---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile.  Try it now.

Re: Why does Tomcat become slow during weekends?

Posted by Philip Wigg <ph...@philipwigg.co.uk>.
> We have a website based on embedded Tomcat with Jboss 4.0.2. We noticed that every weekend the Tomcat becomes sluggish. I mean there are no errors like HTTP404. The website simply hangs. We theorized that JVM is busy with garbage collection. Is that realistic? Does anyone have any other suggestions?

What's the load average or CPU busy time of the server? Do you, or
might you expect, to get more website traffic at weekends?

Are there any obvious causes of Tomcat hanging? For example, if you
look inside the Tomcat manager application can you see if you are
running out of free heap space?

---------------------------------------------------------------------
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: Why does Tomcat become slow during weekends?

Posted by Peter Crowther <Pe...@melandra.com>.
> From: murthy gandikota [mailto:murthy_gandikota@yahoo.com]
> Peter Crowther <Pe...@melandra.com> wrote:    >
> From: murthy gandikota [mailto:murthy_gandikota@yahoo.com]
> > We have a website based on embedded Tomcat with Jboss 4.0.2.
> > We noticed that every weekend the Tomcat becomes sluggish.
[...]
>   There is no other system maintenance more than what I have
> mentioned. The Tomcat runs on a physical server. Heard a
> virtual server will be even slower.

Generally yes.  If it was on a virtual server, I'd have suggested that another virtual server on the same host might have been hogging resources - but that's not an option.

My next suggestion is to look for the gross cause of the slowdown.  Performance Monitor (on Windows) or top / vmstat (on UNIX) and see whether you're short of memory, CPU or disk bandwidth when the system goes slow.  If one of those is the problem, the next step is to narrow down which process is the memory, CPU or I/O hog and find out why it only happens at weekends.  If you're not short of any of those, the next step would probably be to look at your database server and try to work out whether that's somehow causing the slowdown.

                - Peter

---------------------------------------------------------------------
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: Why does Tomcat become slow during weekends?

Posted by David kerber <dc...@verizon.net>.
murthy gandikota wrote:
> David kerber <dc...@verizon.net> wrote:    
>   
>> Just a SWAG: Maybe the traffic slows down so much that the database (if 
>> there is one) is timing out connections and dumping stuff from its 
>> cache, so that when people do hit it, the db has to create a new 
>> connection and read lots of stuff from disk, which was in RAM cache 
>> during the week?
>> D
>>     
>
>   This seems likely as we have seen some problems with DB connections. I am not sure how to keep the DB connections alive when there is no traffic on the website.
>   
What we ended up doing was extending the connection timeout setting in 
the database so that it would keep it alive over a weekend.  Of course, 
this will use a few more resources on the DB server, but that's not 
likely to be limiting. 

I don't know what you could do about the cold cache issue, though; maybe 
a cron job to periodically run some typical queries against the 
database?  Actually, that would take care of the connection timeout 
issues as well.

D



---------------------------------------------------------------------
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: Why does Tomcat become slow during weekends?

Posted by murthy gandikota <mu...@yahoo.com>.

David kerber <dc...@verizon.net> wrote:    
>Just a SWAG: Maybe the traffic slows down so much that the database (if 
>there is one) is timing out connections and dumping stuff from its 
>cache, so that when people do hit it, the db has to create a new 
>connection and read lots of stuff from disk, which was in RAM cache 
>during the week?
>D

  This seems likely as we have seen some problems with DB connections. I am not sure how to keep the DB connections alive when there is no traffic on the website.
   
  Thanks 
  Murthy 


---------------------------------------------------------------------
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




       
---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile.  Try it now.

Re: Why does Tomcat become slow during weekends?

Posted by David kerber <dc...@verizon.net>.
murthy gandikota wrote:
> Peter Crowther <Pe...@melandra.com> wrote:    > From: murthy gandikota [mailto:murthy_gandikota@yahoo.com]
>   
>> We have a website based on embedded Tomcat with Jboss 4.0.2.
>> We noticed that every weekend the Tomcat becomes sluggish.
>>     
>
> Backups? Congestion on the network due to a site that's only accessed heavily at weekends?
>    
>   There are no backups. The website uses DB2 which is backed up infrequently. And all of our users use the site during business hours on weekdays.
>   
>   
>> We theorized that JVM is busy with garbage collection.
>> Is that realistic?
>>     
>
> No. The JVM collects garbage at intervals measured in seconds or minutes, and takes milliseconds or seconds. It also doesn't know about weekends :-).
>
>   I forgot to mention that there is an apache/mod-jk load balancer in the front end. On weekends we end up restarting everything including apache and jboss. 
>    
>   
>> Does anyone have any other suggestions?
>>     
>
> I'd guess system maintenance of some kind. Is this on a physical server or a virtual one?
>
>   There is no other system maintenance more than what I have mentioned. The Tomcat runs on a physical server. Heard a virtual server will be even slower.
>   
> - Peter
>
>   Thanks
>   Murthy
>   
Just a SWAG:  Maybe the traffic slows down so much that the database (if 
there is one) is timing out connections and dumping stuff from its 
cache, so that when people do hit it, the db has to create a new 
connection and read lots of stuff from disk, which was in RAM cache 
during the week?

D



---------------------------------------------------------------------
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: Why does Tomcat become slow during weekends?

Posted by murthy gandikota <mu...@yahoo.com>.

Peter Crowther <Pe...@melandra.com> wrote:    > From: murthy gandikota [mailto:murthy_gandikota@yahoo.com]
> We have a website based on embedded Tomcat with Jboss 4.0.2.
> We noticed that every weekend the Tomcat becomes sluggish.

Backups? Congestion on the network due to a site that's only accessed heavily at weekends?
   
  There are no backups. The website uses DB2 which is backed up infrequently. And all of our users use the site during business hours on weekdays.
  
> We theorized that JVM is busy with garbage collection.
> Is that realistic?

No. The JVM collects garbage at intervals measured in seconds or minutes, and takes milliseconds or seconds. It also doesn't know about weekends :-).

  I forgot to mention that there is an apache/mod-jk load balancer in the front end. On weekends we end up restarting everything including apache and jboss. 
   
> Does anyone have any other suggestions?

I'd guess system maintenance of some kind. Is this on a physical server or a virtual one?

  There is no other system maintenance more than what I have mentioned. The Tomcat runs on a physical server. Heard a virtual server will be even slower.
  
- Peter

  Thanks
  Murthy

       
---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile.  Try it now.

RE: Why does Tomcat become slow during weekends?

Posted by Peter Crowther <Pe...@melandra.com>.
> From: murthy gandikota [mailto:murthy_gandikota@yahoo.com]
> We have a website based on embedded Tomcat with Jboss 4.0.2.
> We noticed that every weekend the Tomcat becomes sluggish.

Backups?  Congestion on the network due to a site that's only accessed heavily at weekends?

> We theorized that JVM is busy with garbage collection.
> Is that realistic?

No.  The JVM collects garbage at intervals measured in seconds or minutes, and takes milliseconds or seconds.  It also doesn't know about weekends :-).

> Does anyone have any other suggestions?

I'd guess system maintenance of some kind.  Is this on a physical server or a virtual one?

                - Peter

---------------------------------------------------------------------
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