[Mongrel] Nightly mongrel issues...

Jeremy Hopple jeremy at jthopple.com
Sat Apr 29 18:44:08 EDT 2006


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.

This problem has never happened we were actively using the application, or
had the application under load... only when we send a request to it for the
first time in the morning.

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...

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.

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.

Thanks again, and let me know what works for you.

Jeremy

On 4/29/06, Zed Shaw <zedshaw at zedshaw.com> wrote:
>
> Usually this happens if you have a Rails handler that gets to a point and
> then stops for some reason.  Since Mongrel has a lock around the dispatcher,
> and you've got an action that isn't exiting, then all subsequent requests
> will become jammed.
>
> Typical things that can do this are not closing files, forking or spawning
> processes and not waiting for them, connecting to remote servers that don't
> answer right away, and even opening too many files.  Look for any actions
> which could possibly cause something like this, especially if you're using
> an external program to do some processing.
>
> I've added a –B option and also created a small set of debugging handlers
> which dump lots of information for you.  It slows your application down, so
> the best way to do it is this:
>
>
>    1. Run mongrel with –B so it dumps thread, memory, etc. information
>    to log/mongrel_debug/*.log files.
>    2. Write a Watir or Selenium test that goes through your application
>    like a user.
>    3. Run the test and watch the mongrel_debug logs, paying attention
>    to the ones reporting files and threads.
>    4. If you see an action that seems to have lots of objects created,
>    lots of threads left open, or dangling files then that's probably the one.
>    5. Go in and fix it.
>
>
> If you're able to let me view your code, I'd like to work through this
> with you.  It's a *very* common problem but I'd like to go through helping
> someone fix it.  Can you get together with me at some point?
>
> Zed
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20060429/90097d03/attachment-0001.htm 


More information about the Mongrel-users mailing list