[n00b] WEBrick hangs overnight -- my bug? Rails?

I’ve got:

$ ruby --version
ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-linux]
$ rails --version
Rails 1.2.3

and I’m running my app via ruby script/server, which brings up

[2007-10-03 11:03:44] INFO WEBrick 1.3.1
[2007-10-03 11:03:44] INFO ruby 1.8.6 (2007-03-13) [i686-linux]
[2007-10-03 11:03:44] INFO WEBrick::HTTPServer#start: pid=21735

This is running on a desktop machine in our lab, somewhere, with
$ uname -a
“Linux bugzilla 2.4.3-12smp #1 SMP Fri Jun 8 14:38:50 EDT 2001 i686

And everything is working well during the daytime. I browse
http://machineName:3000/app/controller and up pops my table – woot!

Then I go home after work. Then I come back in the morning. Then I hit
refresh on my browser to see the updated table.

And the URL request is sent, but then there is no response from the

I close & open a new browser window/tab. Try again. Same problem –
page starts to load, but nothing ever comes.

Eventually, I kill ruby/WEBrick and restart, then everything works fine.

This has happened on 3 overnights in a row. (I expect it will happen
again tonight.)


  • Is it possible that I’ve got some code in my rails app that, during
    idle time, brings the server down?

  • Is there a known issue/fragility in WEBrick that might make it behave
    this way?

  • What can I do to make it not-hang overnight?

    — SEPARATE ISSUE (maybe) —

The server (bugzilla) is running apache. Should I learn how to hook-up
my rails apps through that, rather than using WEBrick? Is that possibly
related to my problem? Things seem to work pretty well, though, so long
as I don’t ignore the program for too long.


My guess is that because nothing is happening in the server that your
MySQL connection is being expired by MySQL. I’m sure I heard this
reported bfeore. There were workarounds discussed, but I don’t recall
what they were. See what Google can dig up or search the archives for
this list.