[Mongrel] Debugging high CPU with Mongrel

Dallas DeVries dallas.devries at gmail.com
Sun Dec 17 22:39:14 EST 2006

Thanks for the strace tip Zed.  It helped me figure out what was wrong.  I
noticed stat64() flying by on pretty much every cache file I have.
Apparently expire_fragment using a regular expression as the argument will
actually go through every single cache file and by midday I have about
30000+ of them so I'm pretty sure that's the cause.  I thought it only tried
matching files in the controller and action it was called from or specified,
this does not appear to be the case.  So I guess I'll have to write a plugin
to change caching or find someone else who solved the same problem.  Thanks
for the help.


On 12/15/06, Zed A. Shaw <zedshaw at zedshaw.com> wrote:
> On Fri, 15 Dec 2006 12:36:47 -0500
> "Dallas DeVries" <dallas.devries at gmail.com> wrote:
> > Alright so I got fastthread installed yesterday.  Unfortunately the
> massive
> > load spike happened again (until rails cache was deleted of
> course).  I'm
> > just wondering if I'm using  killall -USR1 mongrel_rails the proper way.
> > What sort of messages should I be looking for?  They are suppose to be
> in
> > mongrel.log right?  Other than turning the toggling debugging mode to
> true I
> > don't seem to be getting any extra info in that mongrel.log or
> > production.log.  Is there some lower level thing I can try? If it really
> is
> > a cache thing and there is a way for me to see it stuck in some process
> > loading or building a fragment or something...
> If you turn on USR1 and don't see any log messages than most likely it's a
> problem that isn't triggering one of the exceptions.  You're turning it on
> right, and you should see a little log message saying it's on.
> If you've got a process that's "stuck" for some reason, try strace -p
> PID.  Using strace you can see what system calls the process is calling and
> then see if it's in some loop or something.
> Another option--which is more advanced--is to attach to the process with
> gdb and then interrupt it and step through.  I haven't used this yet, but
> check out Jamis Buck's blog and a few others for handy macros that can dump
> the Ruby callstack.
> >  Are the 0.3.19pr items pretty much centered around the MIME type stuff
> or
> > should I try upgrading to that from .18pr?
> Yeah, it's MIME that was put into the 0.3.19 and just a few fastthread
> changes.
> --
> Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu
> http://www.zedshaw.com/
> http://www.awprofessional.com/title/0321483502 -- The Mongrel Book
> http://mongrel.rubyforge.org/
> http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help.
> _______________________________________________
> Mongrel-users mailing list
> Mongrel-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/mongrel-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061217/c2fa660a/attachment-0001.html 

More information about the Mongrel-users mailing list