title: Rails app randomly crashes with error "Premature end of script headers"
body: <p>I am hosting a Ruby on Rails 2.0.2 application on DreamHost. It is on an Apache 2 server, running on top of Phusion Passenger. </p>
  
  <p>The application often returns a 500 error "Rails application failed to start properly", but at random times. It appears to happen when the application is under higher load, though I can't confirm this. It only gets about 2,000 pageviews per day, so I don't think load should really be an issue.</p>
  
  <p>The Apache logs correlate these 500 responses with the error: "Premature end of script headers". Just looking at the logs at 9 AM today, the error appears as often as three or four times a minute. This is clearly unacceptable.</p>
  
  <p>Less frequently, the application hurls a Phusion Passenger page with a stack trace and the error "Broken pipe".</p>
  
  <p>The Rails logs do not list any of these errors.</p>
  
  <p>This happens on both the staging and live sites hosted on DreamHost, but I can't replicate it on a local development server.</p>
  
  <p>So I guess the real question is: <strong>Where do I begin to debug this problem?</strong></p>