MySQL connection problems on Dreamhost

To all fellow Dreamhosters out there…

Sometimes my app mysteriously loses its connection to the database,
resulting in a big ugly “Application Error (Rails)” page. Usually
refreshing the page makes it go away, but not today. :frowning:

In production.log I see this:

MysqlError (Lost connection to MySQL server during query):

Any idea why this happens? It’s rather intermittent and random, but I
get this a few times a week.

I’ve pasted a large section of the call stack below in case it helps.



real_connect' /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/mysql_adapter.rb:316:inconnect’
initialize' /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/mysql_adapter.rb:37:innew’
mysql_connection' /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:145:insend’
connection_without_query_cache=' /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/query_cache.rb:54:inconnection=’
retrieve_connection' /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:20:inconnection’
columns' /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/base.rb:746:incolumn_names’
column_methods_hash' /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/base.rb:1016:inall_attributes_exists?’
all?' /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/base.rb:1016:ineach’
all?' /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/base.rb:1016:inall_attributes_exists?’
method_missing' /app/models/trivia_question.rb:6:infor_today’

I have been running a Rails app on Dreamhost for a couple of weeks now
(just launched official beta Sat) and I have not yet run into any issues
like this. If I do notice them I will let you know, though.


On Apr 30, 2006, at 2:25 PM, Jeff C. wrote:

Any idea why this happens? It’s rather intermittent and random, but I
get this a few times a week.

You might ask your hosting provider. Their database might be
restarting and causing your connection to disappear.

…or perhaps your application is attempting to run queries that are
above their memory allocation limits and it kills the query during
the process of fetching data.

Good luck tracking down the solution.



Robby R.
Founder & Executive Director

Ruby on Rails Development, Consulting & Hosting

+1 503 445 2457
+1 877 55 ARGON [toll free]
+1 815 642 4968 [fax]

i’ve talked to dreamhost a couple of times about this. it happens on
occasion, which is really annoying. all the static pages come up
fine, but mysql connections die. they told me it’s because another
account on the same server is hogging all the bandwidth and that
mysql is the first to die in that situation.

i would just email them about it. they always replied to me within a

good luck.


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs