title: couchdb views os_process_error - big documents
body: <p>I have a database that we're filling up with documents, some of which are 10 KB, and some of which that are ~70 MB in size.</p>
  
  <p>Any view that tries to load these large documents fails with error: <strong>{"error":"os_process_error","reason":"{exit_status,0}"}</strong>, even this elementary one:</p>
  
  <pre><code>function(doc) {
      emit(null, "test");
  }
  </code></pre>
  
  <p><strong>os_process_error</strong> is set to 35000, but calling the view dies in ~15 seconds:</p>
  
  <pre><code>time curl -X GET http://localhost:5984/portal_production/_design/all_data_keys/_view/view1
  {"error":"os_process_error","reason":"{exit_status,0}"}
  
  real    0m15.907s
  user    0m0.016s
  sys 0m0.000s
  </code></pre>
  
  <p>From a few other threads, seems like this is related stack size: <a href="https://issues.apache.org/jira/browse/COUCHDB-893" rel="nofollow">couchdb issue thread</a>. I've applied this patch to increase the stack size, although I couldn't find a reference to the method's value. So I'm shooting in the dark a bit.</p>
  
  <p>Soooo.... the real question is: what is the correct approach for using views on large documents? I'm sure I'm not the first to have this problem. </p>