title: Random slow Rack::MethodOverride#call on rails app on Heroku
body: <p>Environment:</p>
  
  <ul>
  <li><p>Ruby: 2.1.2</p></li>
  <li><p>Rails: 4.1.4</p></li>
  <li><p>Heroku</p></li>
  </ul>
  
  <p>In our rails app hosted on Heroku, there are times that requests take a long time to execute. It is just 1% of times or less, but we cannot figure out what it is happening.</p>
  
  <p>We have newrelic agent installed and it says that <strong>it is not request-queuing</strong>, it is the transaction itself who takes all that time to execute.</p>
  
  <p>However, transaction trace shows this:</p>
  
  <p><img src="https://i.stack.imgur.com/DlSs9.png" alt="enter image description here"></p>
  
  <p>(this same request most of the times takes only 100ms to be executed)</p>
  
  <p>As far as I can tell, the time is being consumed before our controller gets invoked. It is consumed on</p>
  
  <pre><code>Rack::MethodOverride#call
  </code></pre>
  
  <p>and that is what we cannot understand.</p>
  
  <p>Also, most of the times (or even always, we are not sure) this happens on POST requests that are sent by mobile devices. Could this have something to do with a slow connection? (although POST-payload is very tiny).</p>
  
  <p>Has anyone experienced this? Any advice on how to keep exploring this issue is appreciated.</p>
  
  <p>Thanks in advance!</p>