Well, I did the post-mortem.  It's not a communication thing, the DB and WK 
are on the same machine.  WK reported no errors whatsoever.  However, the 
apache logs are full of "failure connecting to appserver attempt X out of 
10" (or something akin to that).  MySQL also has reported nothing.  Looking 
at the logs, the MySQL error I reported below seems to be unrelated 
(although I am definitely doing something wrong with these connections; any 
literature guys?).

So, long story short it seems that WK just gave up.  Now, I got an 
idea/request: since I am using mod_webkit (linux), how hard would it be to 
rig mod_webkit up to restart the WK appserver if it has failed to connect 
after X attempts?

Thanks for the help everybody.  I've been googling for some good reference 
on how to manage DB connections on a DB-backed website and I've only come 
across pretty basic stuff.  Any pointers?

Thanks,

Costas



>From: "Aaron Held" <[EMAIL PROTECTED]>
>To: "Costas Malamas" <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
>CC: <[EMAIL PROTECTED]>
>Subject: Re: [Webware-discuss] Webkit hangs after MySQL error
>Date: Fri, 8 Feb 2002 17:35:19 -0500
>
>I had a similar problem.
>When I ran webkit on a Win2k server and connected to a Linux
>database through a firewall the connection would be cut off every
>night.
>Turned out to be a firewall rule. I can keep the conn open now,
>but if the connection gets severed then the webkit app hangs.
>
>I have not had time to address this yet, but its a problem.
>
>-Aaron
>----- Original Message -----
>From: "Costas Malamas" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Cc: <[EMAIL PROTECTED]>
>Sent: Thursday, February 07, 2002 6:34 PM
>Subject: Re: [Webware-discuss] Webkit hangs after MySQL error
>
>
> >
> > I still haven't been able to ssh in, but it certainly looked
>like the
> > appserver was down, as no servlet was responding.  A friend
>restarted WK and
> > all is fine now, so...
> >
> > Any pointers as to how I can make the connection more robust?
>Is it worth
> > re-using the connection, or should I re-initialize it in the
>servlet's
> > __init__(), for example?  If not, is there a way to test the
>connection and
> > restart it if it's dead (maybe wrap it in a try/except)?
> >
> > I guess if there was a way I could intentionally "starve" WK so
>I can try
> > out different tactics, that would be even more useful.
> >
> > Thanks,
> >
> > Costas
> >
> >
> >
> > >From: Ian Bicking <[EMAIL PROTECTED]>
> > >To: Costas Malamas <[EMAIL PROTECTED]>
> > >CC: [EMAIL PROTECTED]
> > >Subject: Re: [Webware-discuss] Webkit hangs after MySQL error
> > >Date: 07 Feb 2002 12:19:26 -0600
> > >
> > >There's a possibility that, because your website got a lot of
>hits some
> > >resource was exhausted (memory, maybe), and that could cause
>multiple
> > >problems.  I.e., whatever closed the connection also caused WK
>to crash.
> > >
> > >Alternatively, I imagine there's also a number of reasons why
>a MySQL
> > >connection could be lost: does your application open a new
>connection if
> > >this happens?
> > >
> > >And, lastly, is the AppServer gone, or are your servlets just
>not
> > >responding?  If the AppServer is gone, it would definitely be
>a bug in
> > >WK (though I don't know what it could do if you run out of
>memory --
> > >though that would be a sign that WK needs to do more to
>preserve
> > >memory).  But if your servlets can't recover from the failure
>at other
> > >points -- like the MySQL connection -- then you'd have to make
>those
> > >portions more robust.
> > >
> > >On Thu, 2002-02-07 at 05:40, Costas Malamas wrote:
> > > > I am trying to diagnose a WebKit crash: my website got a
>large number of
> > > > hits yesterday, and apparently WK crashed completely.  WK
>is connected
> > >to
> > > > MySQL on the backend, and the last thing I saw from WK (I
>cannt telnet
> > >to
> > > > the box to do forensics on WK yet) was a MySQL error: "lost
>connection
> > >to
> > > > the database".
> > > >
> > > > Now, MySQL is still up and running (I am using phpmyadmin
>so I am sure
> > >the
> > > > system's OK), but I am trying to figure out why WK reacted
>so badly.
> > > >
> > > > One possible reason:  in my classes, I am opening a single
>mysql
> > >connection
> > > > that's instantiated once and passed around to every
>DB-dependant class.
> > >Is
> > > > it possible that a WK crash closed this connection and then
>the servlets
> > > > cannot re-open it?  if so, is there a work-around for this?
> > > >
> > > > Even more general, possible OT:  am I better off
>performance wise, to
> > >re-use
> > > > the same DB connection, or instead open up one per-servlet
>instance or
> > > > something?
> > > >
> > > > Thanks,
> > > >
> > > > Costas
> > > >
> > > >
> > > >
> > > >
>_________________________________________________________________
> > > > Join the world's largest e-mail service with MSN Hotmail.
> > > > http://www.hotmail.com
> > > >
> > > >
> > > > _______________________________________________
> > > > Webware-discuss mailing list
> > > > [EMAIL PROTECTED]
> > > >
>https://lists.sourceforge.net/lists/listinfo/webware-discuss
> > > >
> > >
> > >
> >
> >
> >
>_________________________________________________________________
> > Join the world's largest e-mail service with MSN Hotmail.
> > http://www.hotmail.com
> >
> >
> > _______________________________________________
> > Webware-discuss mailing list
> > [EMAIL PROTECTED]
> > https://lists.sourceforge.net/lists/listinfo/webware-discuss
>
>


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.


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

Reply via email to