[Mongrel] Nightly mongrel issues...

Zed Shaw zedshaw at zedshaw.com
Sun Apr 30 15:59:24 EDT 2006


Hey Jeremy,

Comments below...


On 4/29/06 6:44 PM, "Jeremy Hopple" <jeremy at jthopple.com> wrote:

> 
> Zed,
> 
> Thanks for getting back to me and I really appreciate all the hard work you've
> put into Mongrel.
> 
> A little bit more background.  I'm in the process of setting up a new,
> dedicated FC4 machine to host 3 applications that I'm getting ready to
> release.  None of them are live yet, but I have two of them in a "staging"
> environment on the new server for testing.
> 
> Both of the applications I have running on the new server have exhibited the
> same behavior multiple times.  Also, they both have done this upon the first
> request after a long period of inactivity (i.e. while we're sleeping).  Unless
> one of the members of my team is testing the application or it's being load
> tested, the apps are idle.
> 

Ah, I'm thinking this is mysql's lame ass connection crap.  Rails opens
connections to the database and just leaves them there.  Since TCP has a
timeout, and mysql doesn't have a heartbeat element to the protocol, your
connections will time out and things go bad.

> The one thing I did realize this morning is that I had not installed the
> latest mysql bindings on the server, so I gem installed mysql ( 2.7).  To tell
> you the truth, I'm not sure which bindings were installed prior to that (ruby
> and mysql were both installed from the fedora yum repositories). I'm wondering
> if something was dying in Rails when it tries to connect to mysql after a long
> period of inactivity...
> 
Yes, I sent another e-mail off-list, but the default mysql.rb that rails has
is total junk.  Always install the mysql native compiled gem, this is also a
performance boost.

> The simpler of the two applications that this is happening with is a very
> basic event system we put together to publish arts and entertainment
> happenings in our local community.  If you'd like to check it out, we're
> currently testing it at http://staging.the-j-list.com.  This application is
> very simple.  It uses a mysql (5.0.18) and sends a few emails with
> ActionMailer (using a remote smtp server).  Prior to launching mongrel in
> debug mode, the only file it opens is the production.log.
>

It seems like the mysql tcp connection is dying during the night.  I'd be
curious to know if this same problem happens under webrick.  In theory it
should since this would be a rails driver problem.

Another thing is, why mysql?  Maybe another database like postgresql doesn't
have these problems.  I've been using postgresql in my apps and I don't any
of these problems.
 
> Assuming nothing above rings any bells, I'd be thrilled to get together with
> you and review the code.  I live only about 2 blocks from my office, so I can
> be here pretty much whenever and we're in Mountain Daylight Time.  Also, I can
> get you access to the svn repository.
> 

Yeah, I've got a mongrel version going out tonight (hopefully), so I'll try
to catch you when I can either tonight or tomorrow.

Zed



More information about the Mongrel-users mailing list