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

**URL:** <https://www.ruby-forum.com/t/n00b-webrick-hangs-overnight-my-bug-rails/116280>\
**Category:** Rails\
**Created:** [October 4, 2007, 3:01am UTC](https://www.ruby-forum.com/t/n00b-webrick-hangs-overnight-my-bug-rails/116280 "2007-10-04T03:01:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![olie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/c4cdca/32.png) [@olie](https://www.ruby-forum.com/u/olie)\
**Post date:** [October 4, 2007, 3:01am UTC](https://www.ruby-forum.com/t/n00b-webrick-hangs-overnight-my-bug-rails/116280/1 "2007-10-04T03:01:06Z")

</div>

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  
port=3000  
[etc…]

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  
unknown”

And everything is working well during the daytime. I browse  
[http://machineName:3000/app/controller](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  
server.

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

Qs:

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

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.

Thanks!

---

<div class="post-metadata">

**Author:** ![olie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/c4cdca/32.png) [@olie](https://www.ruby-forum.com/u/olie)\
**Post date:** [October 4, 2007, 4:23am UTC](https://www.ruby-forum.com/t/n00b-webrick-hangs-overnight-my-bug-rails/116280/2 "2007-10-04T04:23:33Z")

</div>

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.
