title: Rails 3: How to return a big JSON document
body: <p>I want to return about 90k items in a JSON document but I'm getting this error when I make the call:</p>
  
  <pre><code>Timeout::Error in ApisController#api_b
  
  time's up!
  Rails.root: /root/api_b
  </code></pre>
  
  <p>I am simply running "rails s" with the default rails server.</p>
  
  <p>What's the way to make this work and return the document?</p>
  
  <p>Thanks</p>
  
  <pre><code>  @bs.each do |a|
            puts "dentro do bs.each"
            @final &lt;&lt; {  :Email =&gt; a['headers']['to'], :At =&gt; a['date'], :subject =&gt; a['headers']['subject'], :Type =&gt; a['headers']['status'], :Message_id =&gt; a['headers']['message_id'] }
          end
  </code></pre>
  
  <p>Being @bs the BSON object from MongoDB. The timeout is in "@final &lt;&lt; ..."</p>