tomcat response is very slow

Discussion in 'Java' started by ruds, Apr 4, 2009.

  1. ruds

    ruds Guest

    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.
     
    ruds, Apr 4, 2009
    #1
    1. Advertising

  2. On 04.04.2009 11:40, ruds wrote:
    > 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
     
    Robert Klemme, Apr 4, 2009
    #2
    1. Advertising

  3. ruds

    Dave Miller Guest

    ruds wrote:
    > 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.

    --
    Dave Miller
    Java Web Hosting
    http://www.cheap-jsp-hosting.com/
     
    Dave Miller, Apr 5, 2009
    #3
  4. ruds

    ruds Guest

    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.
     
    ruds, Apr 6, 2009
    #4
  5. ruds

    Dave Miller Guest

    ruds wrote:
    > 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.

    --
    Dave Miller
    Java Web Hosting
    http://www.cheap-jsp-hosting.com/
     
    Dave Miller, Apr 6, 2009
    #5
  6. ruds

    Arne Vajhøj Guest

    ruds wrote:
    > 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
     
    Arne Vajhøj, Apr 7, 2009
    #6
  7. ruds

    ruds Guest

    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.
     
    ruds, Apr 7, 2009
    #7
  8. ruds

    Dave Miller Guest

    Arne Vajhøj wrote:

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

    --
    Dave Miller
    Java Web Hosting
    http://www.cheap-jsp-hosting.com/
     
    Dave Miller, Apr 7, 2009
    #8
  9. On 07.04.2009 16:04, Dave Miller wrote:
    > Arne Vajhøj wrote:
    >
    >> 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.


    What empirical facts do you base this assessment on?

    robert
     
    Robert Klemme, Apr 7, 2009
    #9
  10. ruds

    Dave Miller Guest

    Robert Klemme wrote:
    > On 07.04.2009 16:04, Dave Miller wrote:
    >> Arne Vajhøj wrote:
    >>
    >>> 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.

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

    --
    Dave Miller
    Java Web Hosting
    http://www.cheap-jsp-hosting.com/
     
    Dave Miller, Apr 7, 2009
    #10
  11. On 07.04.2009 18:39, Dave Miller wrote:
    > Robert Klemme wrote:
    >> On 07.04.2009 16:04, Dave Miller wrote:
    >>> Arne Vajhøj wrote:
    >>>
    >>>> 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.

    >>
    >> What empirical facts do you base this assessment on?
    >>

    > 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
     
    Robert Klemme, Apr 7, 2009
    #11
  12. ruds

    Arne Vajhøj Guest

    Dave Miller wrote:
    > Arne Vajhøj wrote:
    >> 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.


    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
     
    Arne Vajhøj, Apr 8, 2009
    #12
  13. ruds

    Arne Vajhøj Guest

    Dave Miller wrote:
    > Robert Klemme wrote:
    >> On 07.04.2009 16:04, Dave Miller wrote:
    >>> Arne Vajhøj wrote:
    >>>
    >>>> 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.

    >>
    >> What empirical facts do you base this assessment on?


    > 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
     
    Arne Vajhøj, Apr 8, 2009
    #13
  14. ruds

    Dave Miller Guest

    Arne Vajhøj wrote:
    > Dave Miller wrote:
    >> Arne Vajhøj wrote:
    >>> 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.

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

    --
    Dave Miller
    Java Web Hosting
    http://www.cheap-jsp-hosting.com/
     
    Dave Miller, Apr 8, 2009
    #14
  15. ruds

    Dave Miller Guest

    Robert Klemme wrote:
    > On 07.04.2009 18:39, Dave Miller wrote:
    >> Robert Klemme wrote:
    >>> On 07.04.2009 16:04, Dave Miller wrote:
    >>>> Arne Vajhøj wrote:
    >>>>
    >>>>> 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.
    >>>
    >>> What empirical facts do you base this assessment on?
    >>>

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

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

    --
    Dave Miller
    Java Web Hosting
    http://www.cheap-jsp-hosting.com/
     
    Dave Miller, Apr 8, 2009
    #15
  16. ruds

    Dave Miller Guest

    Arne Vajhøj wrote:
    > Dave Miller wrote:
    >> Robert Klemme wrote:
    >>> On 07.04.2009 16:04, Dave Miller wrote:
    >>>> Arne Vajhøj wrote:
    >>>>
    >>>>> 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.
    >>>
    >>> What empirical facts do you base this assessment on?

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

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

    --
    Dave Miller
    Java Web Hosting
    http://www.cheap-jsp-hosting.com/
     
    Dave Miller, Apr 8, 2009
    #16
  17. ruds

    Roedy Green Guest

    On Sat, 4 Apr 2009 02:40:54 -0700 (PDT), ruds <>
    wrote, quoted or indirectly quoted someone who said :

    >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.
     
    Roedy Green, Apr 10, 2009
    #17
  18. ruds

    ruds Guest

    On Apr 10, 3:35 pm, Roedy Green <>
    wrote:
    > On Sat, 4 Apr 2009 02:40:54 -0700 (PDT), ruds <>
    > wrote, quoted or indirectly quoted someone who said :
    >
    > >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.
    > 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?
     
    ruds, Apr 13, 2009
    #18
  19. ruds

    Lew Guest

    ruds wrote:
    > "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.

    --
    Lew
     
    Lew, Apr 13, 2009
    #19
  20. ruds

    ruds Guest

    On Apr 13, 6:17 pm, Lew <> wrote:
    > ruds wrote:
    > > "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.


    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.
     
    ruds, Apr 14, 2009
    #20
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Earl Teigrob
    Replies:
    7
    Views:
    469
    Scott M.
    Feb 16, 2004
  2. Kevin
    Replies:
    1
    Views:
    484
    ~kurt
    May 25, 2007
  3. Kevin
    Replies:
    1
    Views:
    370
    Tris Orendorff
    May 25, 2007
  4. Alf P. Steinbach /Usenet

    Slow -- VERY slow brain

    Alf P. Steinbach /Usenet, Jun 16, 2011, in forum: C++
    Replies:
    17
    Views:
    553
    Noah Roberts
    Jun 29, 2011
  5. Nick Green
    Replies:
    4
    Views:
    214
    Nick Green
    Nov 18, 2009
Loading...

Share This Page