# Rails crashes over night?

**URL:** <https://www.ruby-forum.com/t/rails-crashes-over-night/98818>\
**Category:** Rails\
**Created:** [December 12, 2005, 7:46pm UTC](https://www.ruby-forum.com/t/rails-crashes-over-night/98818 "2005-12-12T19:46:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stephan\_van\_Erp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a9adbd/32.png) [@Stephan\_van\_Erp](https://www.ruby-forum.com/u/Stephan_van_Erp)\
**Post date:** [December 12, 2005, 7:46pm UTC](https://www.ruby-forum.com/t/rails-crashes-over-night/98818/1 "2005-12-12T19:46:16Z")

</div>

* * *

Rails mailing list  
removed\_email\_address@domain.invalid  
[http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

---

<div class="post-metadata">

**Author:** ![Stephan\_van\_Erp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a9adbd/32.png) [@Stephan\_van\_Erp](https://www.ruby-forum.com/u/Stephan_van_Erp)\
**Post date:** [December 12, 2005, 8:16pm UTC](https://www.ruby-forum.com/t/rails-crashes-over-night/98818/2 "2005-12-12T20:16:26Z")

</div>

On Mon, 12 Dec 2005, Stephan van Erp wrote:

> I’m running Ruby on Rails on Fedora Core 4 with lighttpd and fastcgi. I also  
> used the login generator (don’t know if relevant). I have the following  
> problem: At day time I work on the server and create/modify ruby files on  
> the server, all pages work fine. Than the next day I want to open de server  
> I get the error at the end of this message (on all pages, including non  
> protected).
> 
> If I restart lighttpd everything works again. Any ideas on how to fix this?  
> This happens every day…

switch to postgresql? seriously - this alone might fix.

we have alot of issues here (noaa) with mysql dropping connections for  
24/7  
type applications. i’ve **never** seen it happen with postgres,  
however.

regards.

-a

---

<div class="post-metadata">

**Author:** ![Stephan\_van\_Erp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a9adbd/32.png) [@Stephan\_van\_Erp](https://www.ruby-forum.com/u/Stephan_van_Erp)\
**Post date:** [December 12, 2005, 8:49pm UTC](https://www.ruby-forum.com/t/rails-crashes-over-night/98818/3 "2005-12-12T20:49:32Z")

</div>

Stephan van Erp schrieb:

> If I restart lighttpd everything works again. Any ideas on how to fix  
> this? This happens every day…

I had such behaviour years ago in a piece of java server I’ve written.  
It was a timeout issue on the sql server (mysql) side. Did you hold any  
connections to speed up something?

My problem was, that my open connection wasn’t close propably and the  
mysql server disconnected. So the next query produced a error like yours  
(of course, the exception was a bit different as it was thrown out of my  
java system).

I’m a little bit suprised because I haven’t a huge experience with RoR  
yet and my guess was, that AR handle the connection prober (?!).

HTH,

---

<div class="post-metadata">

**Author:** ![Stephan\_van\_Erp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a9adbd/32.png) [@Stephan\_van\_Erp](https://www.ruby-forum.com/u/Stephan_van_Erp)\
**Post date:** [December 12, 2005, 11:47pm UTC](https://www.ruby-forum.com/t/rails-crashes-over-night/98818/4 "2005-12-12T23:47:05Z")

</div>

AFAIK if connection to MySQL database is dropped then mysql-connector  
JDBC  
driver tries to reconnect several times to server. Only then it drops  
exception.

I would be really cool to see such functionality in ActiveRecord (or  
mysql  
driver??) because this problem with connection timeout very annoying me  
as  
well.

---

<div class="post-metadata">

**Author:** ![Stephan\_van\_Erp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a9adbd/32.png) [@Stephan\_van\_Erp](https://www.ruby-forum.com/u/Stephan_van_Erp)\
**Post date:** [December 13, 2005, 6:05pm UTC](https://www.ruby-forum.com/t/rails-crashes-over-night/98818/5 "2005-12-13T18:05:56Z")

</div>

Anatol P. schrieb:

> AFAIK if connection to MySQL database is dropped then mysql-connector  
> JDBC driver tries to reconnect several times to server. Only then it  
> drops exception.
> 
> I would be really cool to see such functionality in ActiveRecord (or  
> mysql driver??) because this problem with connection timeout very  
> annoying me as well.

Yes, you have to pass an argument to the JDBC driver . In which case  
this affects the ruby mysql driver as well was not tested by me.

## g,

Daniel Völkerts  
Protected by Anti Pesto.
