profiling webapps under tomcat - threads and samples?

Discussion in 'Java' started by bugbear, Jun 12, 2007.

  1. bugbear

    bugbear Guest

    I have an application running under tomcat;
    In an attempt to "make things better"
    I used java's built in profiling to see what was
    going on:

    -Xrunhprof:cpu=samples,depth=40,thread=y

    during a run where an external
    script hammered the port as hard as possible.

    I am most confused by the resulting
    profile, which shows 72% of the time apparently
    spent in java.net.PlainSocketImpl.socketAccept
    and java.net.PlainSocketImpl.socketClose.

    In fact, it appears that only 20% of the time is
    spent in "my" code, which doesn't sit happily
    with me, since if I deliberately slow
    my code down by (say) 50%, the external
    script (which has timing code in it)
    also slows down nicely, in roughly equal proportion.

    I think I'm being led astray by the java
    profiler's behaviours under multi threading.

    Could anybody help me, either with detailed
    documentation of what the profile samples mean
    (and how they relate to elapsed time, user time,
    etc), or (more specifically) issues
    involved in profiling webapps under tomcat?

    BugBear
     
    bugbear, Jun 12, 2007
    #1
    1. Advertisements

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. charly
    Replies:
    5
    Views:
    2,047
  2. Dean Rettig
    Replies:
    2
    Views:
    5,763
    X_AWemner_X
    Dec 29, 2003
  3. Martin Eberle
    Replies:
    2
    Views:
    978
  4. Frederic
    Replies:
    0
    Views:
    534
    Frederic
    Feb 23, 2005
  5. PaoloCastle
    Replies:
    1
    Views:
    474
    PaoloCastle
    Apr 17, 2005
  6. WD
    Replies:
    1
    Views:
    2,162
    Raymond DeCampo
    Aug 19, 2005
  7. PeterH
    Replies:
    2
    Views:
    2,589
    Juha Laiho
    Oct 9, 2005
  8. Replies:
    4
    Views:
    6,624
    Tor Iver Wilhelmsen
    Nov 4, 2006
Loading...