# Fcgi,lighty mysql database problem

**URL:** <https://www.ruby-forum.com/t/fcgi-lighty-mysql-database-problem/62745>\
**Category:** Rails\
**Created:** [June 7, 2006, 8:10pm UTC](https://www.ruby-forum.com/t/fcgi-lighty-mysql-database-problem/62745 "2006-06-07T20:10:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![beachguy82](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/9dc877/32.png) [@beachguy82](https://www.ruby-forum.com/u/beachguy82)\
**Post date:** [June 7, 2006, 8:10pm UTC](https://www.ruby-forum.com/t/fcgi-lighty-mysql-database-problem/62745/1 "2006-06-07T20:10:44Z")

</div>

I’ve been trying to get fast cgi working for nearly a month now. Yes,  
an entire month! The application starts perfect, but it will die  
randomly after several hours. I have traced the problem back  
to /usr/lib/ruby/1.8/mysql.rb:1042:in `flush’ This happens when the app  
trys to query the database driver to see if it still has a connnection.  
This causes the app to crash. Here is my error dump. Can anyone help?

Errno::EPIPE (Broken pipe):  
/usr/lib/ruby/1.8/mysql.rb:1042:in `flush' /usr/lib/ruby/1.8/mysql.rb:1042:in `write’  
/usr/lib/ruby/1.8/mysql.rb:462:in `write' /usr/lib/ruby/1.8/mysql.rb:436:in `command’  
/usr/lib/ruby/1.8/mysql.rb:307:in `stat' /vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:147:in `active?’  
/vendor/rails/activerecord/lib/active\_record/connection\_adapters/abstract\_adapter.rb:85:in  
`verify!' /vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:99:in `verify\_active\_connections!’  
/vendor/rails/activerecord/lib/active\_record/connection\_adapters/abstract/connection\_specification.rb:98:in  
`verify\_active\_connections!’

Charlie B.  
[http://www.recentrambles.com](http://www.recentrambles.com)

---

<div class="post-metadata">

**Author:** ![beachguy82](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/9dc877/32.png) [@beachguy82](https://www.ruby-forum.com/u/beachguy82)\
**Post date:** [June 7, 2006, 11:36pm UTC](https://www.ruby-forum.com/t/fcgi-lighty-mysql-database-problem/62745/2 "2006-06-07T23:36:34Z")

</div>

> I’ve been trying to get fast cgi working for nearly a month now. Yes, an  
> entire month! The application starts perfect, but it will die randomly  
> after  
> several hours. I have traced the problem back to  
> /usr/lib/ruby/1.8/mysql.rb:1042:in `flush' This happens when the app trys to query the database driver to see if it still has a connnection. This causes the app to crash. Here is my error dump. Can anyone help? Errno::EPIPE (Broken pipe): /usr/lib/ruby/1.8/mysql.rb:1042:in`flush’  
> /usr/lib/ruby/1.8/mysql.rb:1042:in `write' /usr/lib/ruby/1.8/mysql.rb:462:in`write’  
> /usr/lib/ruby/1.8/mysql.rb:436:in `command' /usr/lib/ruby/1.8/mysql.rb:307:in`stat’

I know you probably don’t want to hear this, but my recommendation is to  
switch  
to PostgreSQL! It looks like MySQL is dropping the connection somehow.  
We had  
lots of problems with MySQL & Lighttpd, then switched to PG 8.1, and  
it’s been  
solid as a rock since January.

---

<div class="post-metadata">

**Author:** ![beachguy82](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/9dc877/32.png) [@beachguy82](https://www.ruby-forum.com/u/beachguy82)\
**Post date:** [June 8, 2006, 2:43pm UTC](https://www.ruby-forum.com/t/fcgi-lighty-mysql-database-problem/62745/3 "2006-06-08T14:43:26Z")

</div>

On Wed, 2006-06-07 at 21:33 +0000, Kian Wright wrote:

> > ```
> > /usr/lib/ruby/1.8/mysql.rb:436:in `command'
> > /usr/lib/ruby/1.8/mysql.rb:307:in `stat'
> > 
> > ```
> 
> I know you probably don’t want to hear this, but my recommendation is to switch  
> to PostgreSQL! It looks like MySQL is dropping the connection somehow. We had  
> lots of problems with MySQL & Lighttpd, then switched to PG 8.1, and it’s been  
> solid as a rock since January.

I am unable to switch from lighty or mysql.

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

Charlie B.  
Programmer  
Castle Branch Inc.
