tomcat response is very slow

R

ruds

Hi,
I have deployed my JSP application on Tomcat 5.5.
Past few days I have been observing that the tomcat server has become
very slow.
even for logging in to the site sometimes takes a lot of time even if
no.of sessions are 5-6.
The CPU usage is not much approx. 15%.
Network utilization is too low.
I'm using tomcat on Citrix server where at a given time 10-12 users
would be using the server.
Please help me as I have to restart the Tomcat server very frequently.
 
R

Robert Klemme

I have deployed my JSP application on Tomcat 5.5.
Past few days I have been observing that the tomcat server has become
very slow.
even for logging in to the site sometimes takes a lot of time even if
no.of sessions are 5-6.
The CPU usage is not much approx. 15%.
Network utilization is too low.
I'm using tomcat on Citrix server where at a given time 10-12 users
would be using the server.
Please help me as I have to restart the Tomcat server very frequently.

First line of defense is to check memory settings. One reason for the
observed behavior could be that you configured more memory to the JVM
than is available on the host thus causing paging.

Next you could check IO bandwidth, especially to the database if there
is one. Also, if you are using a database, you want to make sure that
there are no issues in the DB.

If all above are ok, then you probably hit an application bottleneck.
Maybe you have a synchronization issue. There are many options and I
guess you will have to apply proper tools (profiler) to deeper look into
this.

Cheers

robert
 
D

Dave Miller

ruds said:
Hi,
I have deployed my JSP application on Tomcat 5.5.
Past few days I have been observing that the tomcat server has become
very slow.
even for logging in to the site sometimes takes a lot of time even if
no.of sessions are 5-6.
The CPU usage is not much approx. 15%.
Network utilization is too low.
I'm using tomcat on Citrix server where at a given time 10-12 users
would be using the server.
Please help me as I have to restart the Tomcat server very frequently.

It sounds like you may have memory management problem. Check the memory
usage when you first start Tomcat and then again every hour for two or
three. If the heap keeps growing, check your app with a profiler.
 
R

ruds

1. I havent assigned any memory values to jvm through tomcat i.e.
through tomcat properties.
2. I am using MS Access as my DB on the same machine as my tomcat.
3. What is a profiller and how is it used?

Thanks.
 
D

Dave Miller

ruds said:
1. I havent assigned any memory values to jvm through tomcat i.e.
through tomcat properties.
2. I am using MS Access as my DB on the same machine as my tomcat.
3. What is a profiller and how is it used?

Thanks.
1. Tomcat default = 64MB.
2. Choice of DB should not affect memory use by your app.
3. A profiler looks at your app while running and reports back memory
and CPU use by thread. If you are using an IDE, consult its manual. If
not IDE, list of open source profilers here:
http://java-source.net/open-source/profilers

Your problem might be caused by any number of things. From your original
post, it sounded like performance was OK when you first started Tomcat
and then deteriorated over time. If so, a likely culprit is a memory
leak (references left open, result sets not closed, etc.) which are most
easily found with a profiler.
 
A

Arne Vajhøj

ruds said:
1. I havent assigned any memory values to jvm through tomcat i.e.
through tomcat properties.

Default for SUN Java is 64 MB, which is not very much.

But it should not cause Tomcat to be slow. It could Tomcat to stop.
2. I am using MS Access as my DB on the same machine as my tomcat.

It should not matter for the slowness, but you should find another
database. JDBC to Access does not work well in a multithreaded
environment (and Tomcat is a such).
3. What is a profiller and how is it used?

A profiler is a tool that shows where time is spend.

It may or may not help you.

Arne
 
R

ruds

Thanks for your replies.
I think it is the memory problem as suggested bu Dave.
When I look at the Task Manager, when tomcat is started the memory
used is very less and afterwards it increases over a period of time,
even when no sessions are running.
I have downloaded the LambdaProbe profiller for tomcat, lets see how
it helps.\Thanks again.
 
D

Dave Miller

Arne said:
Default for SUN Java is 64 MB, which is not very much.

Most people do not set Xmx (and therefore are using < 64MB). Almost any
well designed app (including most frameworks) run comfortably within it.
 
R

Robert Klemme

Most people do not set Xmx (and therefore are using < 64MB). Almost any
well designed app (including most frameworks) run comfortably within it.

What empirical facts do you base this assessment on?

robert
 
D

Dave Miller

Robert said:
What empirical facts do you base this assessment on?

robert
We provide private JVM Tomcat hosting, mostly to programmers. We suggest
that people start / test with 64MB and buy more memory as needed. Many
are using frameworks, hibernate, etc. Less than 10% need more memory.

Most customers run one app per container. One customer that I'm familiar
with kept adding apps. On his 6th he needed to go to 128MB.
 
R

Robert Klemme

We provide private JVM Tomcat hosting, mostly to programmers. We suggest
that people start / test with 64MB and buy more memory as needed. Many
are using frameworks, hibernate, etc. Less than 10% need more memory.

Most customers run one app per container. One customer that I'm familiar
with kept adding apps. On his 6th he needed to go to 128MB.

Aha, then your statement solely referred to web apps hosted on Tomcat.
It sounded as if you were referring to *all* types of Java apps.

Cheers

robert
 
A

Arne Vajhøj

Dave said:
Most people do not set Xmx (and therefore are using < 64MB). Almost any
well designed app (including most frameworks) run comfortably within it.

In the server context it is nothing.

BEA JRockit (or whatever Oracle may have renamed it to) defaults to 1.5
GB in server mode on 32 bit Windows.

Even desktop apps can easily exceed it.

Arne
 
A

Arne Vajhøj

We provide private JVM Tomcat hosting, mostly to programmers. We suggest
that people start / test with 64MB and buy more memory as needed. Many
are using frameworks, hibernate, etc. Less than 10% need more memory.

Most customers run one app per container. One customer that I'm familiar
with kept adding apps. On his 6th he needed to go to 128MB.

I don't know your customers.

But my experience is that Java EE boxes goes 2 GB, 4 GB, 8 GB, ...
RAM and then appropriately Xmx settings (and 64 bit for anything
except 2 GB).

Arne
 
D

Dave Miller

Arne said:
In the server context it is nothing.

BEA JRockit (or whatever Oracle may have renamed it to) defaults to 1.5
GB in server mode on 32 bit Windows.

Even desktop apps can easily exceed it.

Arne
Desktop apps have the expense of rendering which can be (often is)
substantial.
 
D

Dave Miller

Robert said:
Aha, then your statement solely referred to web apps hosted on Tomcat.
It sounded as if you were referring to *all* types of Java apps.

Cheers

robert
Correct - I was answering in the context of the OP's problem with a web
app in a Tomcat container.
 
D

Dave Miller

Arne said:
I don't know your customers.

But my experience is that Java EE boxes goes 2 GB, 4 GB, 8 GB, ...
RAM and then appropriately Xmx settings (and 64 bit for anything
except 2 GB).

Arne
The OP was asking about Tomcat (a servlet only container not EE /
application).
 
R

Roedy Green

Please help me as I have to restart the Tomcat server very frequently.

If restarting helps, this implies you are gradually using up the RAM.
See http://mindprod.com/jgloss/packratting.html for what to do about
it. Basically you are probably holding onto something you don't need.
It might be quite legit, e.g. caching something and the cache just
grows and grows.
--
Roedy Green Canadian Mind Products
http://mindprod.com

"The most significant trend in the US industry has been the decline in the amount
of energy recovered compared to energy expended. In 1916, the ratio was about 28
to 1, a very handsome energy return. By 1985, the ratio had dropped to 2 to 1,
and it is still dropping."
~ Walter Youngquist, Professor of Geology

By 2003, it had dropped to 0.5 to 1 in the US, making oil extraction no longer economically viable, no matter how high the price of crude.
 
R

ruds

If restarting helps, this implies you are gradually using up the RAM.
Seehttp://mindprod.com/jgloss/packratting.htmlfor what to do about
it.  Basically you are probably holding onto something you don't need.
It might be quite legit, e.g. caching something and the cache just
grows and grows.
--

"Packratting" tells only about imges, frames,threads,etc.
I haven't used any of these in my app.
I have closed the resultsets too.
Tomcat is seen going upto 101,500K as seen in task manager.
Is it ok?
 
L

Lew

ruds said:
"Packratting" tells only about imges, frames,threads,etc.

"Packratting" refers to maintaining object references after the objects'
useful lifetimes. I guess your "etc." refers to "objects". Packratting
certainly does not refer only to images and "frames", and it involves threads
only tangentially.
I haven't used any of these in my app.

You'd darn well better have objects in your application. I guarantee you have
at least one.
I have closed the resultsets [sic] too.
Tomcat is seen going upto 101,500K as seen in task manager.
Is it ok?

Probably. I assume by "task manager" you are referring to the MS Windows Task
Manager application. That is a very blunt instrument for watching Java memory
usage. Among other things, it doesn't distinguish the heap from other memory.

100 KB is not an unusual amount of memory for Tomcat to use.
 
R

ruds

"Packratting" refers to maintaining object references after the objects'
useful lifetimes.  I guess your "etc." refers to "objects".  Packratting
certainly does not refer only to images and "frames", and it involves threads
only tangentially.


You'd darn well better have objects in your application.  I guarantee you have
at least one.

Yes, Obviously I have used objects in my app.
I have also kept the session time out as 10 mins if the window is
idle.So that would handle the object references, is'nt?
I have also, deployed Tomcat Profiller, LambdaProbe for checking
memory of JVM.
If I do a quick check on it the values are all within limits.
What else can I do to improve the response time of Tomcat.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,906
Latest member
SkinfixSkintag

Latest Threads

Top