On Wednesday 13 February 2002 11:35 am, Geoffrey Talvola wrote:
> There have been a few people recently who have had to restart their
> appserver because it stopped responding to requests.  I have a theory
> and a possible way to track it down.
>
> My theory is that servlets are hanging for some reason -- perhaps due
> to a bug in Webware, but more likely due to a coding bug or a bug in
> a 3rd-party module.  If you are running 10 threads in your appserver,
> you can have 9 servlets hang and it'll still respond to requests on
> the 10th thread.  But once the 10th thread hangs, the appserver is
> stuck.  Perhaps this is what's happening.
>
> One way to track this down is to add code that logs when a thread
> begins processing a request, and when a thread finishes processing a
> request. Then, you can scan the log to find out which URL's are
> causing servlets to hang -- they start to process a request but never
> finish.
>
> This call can be used to get the name of the current thread:
> threading.currentThread().getName()
>
> So you could add logging to the servlet's awake() and sleep() methods
> that would log a sequence number, a timestamp, the URL being
> accessed, and the thread name.  If the log contains an awake()
> message but no corresponding sleep() message, you know that that
> request locked up the servlet.
>
> I've also thought of more elaborate schemes where the appserver
> itself would keep track of which servlets are taking a long time and
> spit out a warning when it looks like a servlet might be wedged,
> perhaps even sending an email to the site administrator.  I might
> implement something like this in the future.

If you have 'Verbose' on in your config files you get output like this:

    9  2002-02-13 13:45:04  /webkit/StockAlerts/StyleSheet.css
    9  0.00 secs            /webkit/StockAlerts/StyleSheet.css

   10  2002-02-13 13:45:08  /webkit/StockAlerts/Admin/Session
   10  0.03 secs            /webkit/StockAlerts/Admin/Session

   11  2002-02-13 13:45:08  /webkit/StockAlerts/StyleSheet.css
   11  0.00 secs            /webkit/StockAlerts/StyleSheet.css


Note that each unique transaction is numbered and gets 2 entries: one 
when it starts and another when it is finished.

You could write a little python script to analyze this output along the 
lines that Geoff stated. eg, if you don't see a finish, something is 
wrong.


Food for thought,
-Chuck

_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to