When you sometimes have "All threads are currently busy", I do not
suggest to look particularly at charts, except perhaps the chart of the
number of active threads.
The charts would give various trends about requests or about other
variables over times (memory, cpu, number of sessions...), but the
charts will only rarely give the cause of some long requests.
Case 1
When you are in the situation of not enough threads (or preferrably,
when you think that it is going to have not enough threads),
I suggest to look at the monitoring page of javamelody and check the
"Current requests" part, which is after the "Statistics" part.
You can click on "Details" on the right to display all of them, if you
have more than one current request.
And if possible for the server, you can refresh the page 3 or 5 times to
see if the current requests are not always the same and if some are more
often there than others.
If you are lucky to have the display of the long current requests, copy
and paste the whole html table in OOo, Word or Notepad right away.
You will get:
- the current stack-trace of this thread to see what it is currently doing
- the http request with parameters
- depending on the configuration, the logged in user
- depending on the configuration, the services and sql requests
currently running
- and for how long, these http request, services and sql requests are
running
In the threads part at the bottom of the monitoring page, you can also
check the stack-traces of all the threads to see what the threads are
doing in general (for example, computing some dirty hibernate objects,
waiting to log on disk or waiting for the database).
Among all the threads, ignore the idle threads of the app server and of
the JVM.
You can also take threads dump as text with the link below the threads
table (take 5 threads dump to have a better idea).
Or, if there is currently no problem on the server, go to case 2.
Case 2
After the fact, you can browse the statistics of the http requests (and
services and sql requests depending on the configuration).
First, choose the period (day, week, month...) of the statistics to
display at the top of the monitoring page.
Click the "Details" on the right of the statistics to see the list of
requests.
Check the first requests. You can also sort the requests by mean
execution time and eventually by max execution time.
Depending on the configuration, you can then click on some of the http
requests, to see what services or sql requests they have executed
including how many times.
Knowing exactly which are statistically the long http requests and which
services or sql requests are the cause for these http requests, you can
then analyze and start to optimize.
Note that if the very long requests have never ended and if you have
killed the server before their ends, then those long requests were
possibly never recorded in the statistics.
bye,
Emeric
Le 13/01/2012 17:01, Sharon Deminsky a �crit :
The mail below contains some advices to find and analyze long requests
and their root causes.
So I submit it again with a better title.
2012/1/25 Sharon Deminsky <sdem...@gmail.com>:
--
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen
The user guide to monitor sql requests is here:
http://code.google.com/p/javamelody/wiki/UserGuide#7._JDBC
If that does not help enough, you can say how your webapp connects to
the database (datasource from jndi, datasource from spring, hibernate ...)
Have you made some progress otherwise?
bye,
Emeric
Le 25/01/2012 19:05, David Karlsen a �crit :
>>>> Le 13/01/2012 17:01, Sharon Deminsky a �crit :
Hi,
The user guide to monitor sql requests is here:
http://code.google.com/p/javamelody/wiki/UserGuide#7._JDBC
If that does not help enough, you can say how your webapp connects to the database (datasource from jndi, datasource from spring, hibernate ...)
Have you made some progress otherwise?
bye,
Emeric