rails/rails — Issue #3566: Traces from 500s results in 10s pause on production system
Author: lypanov
Created: 2011-11-08 10:30:07+00:00
State: open

Spent a while in the code and narrowed it down.

For me the fix is to remove "table_exists?" check from def inspect on AR base.rb. Not sure if memorizing is the answer here, so didn't write the patch.

Rack::Mount is calling "inspect" seriously large numbers of times (* 4ms per call to table_exists with my mysql setup) but only when you have a non trivial routes file (500's are instant with 1 route, but for a real app it takes upwards of 7 seconds) and something 500s.