title: How to use Request js (Node js Module) pools
body: <p>Can someone explain how to use the request.js pool hash?</p>
  
  <p>The <a href="https://github.com/mikeal/request/wiki" rel="noreferrer">github notes</a> say this about pools:</p>
  
  <blockquote>
    <p>pool - A hash object containing the agents for these requests. If omitted this 
    request will use the global pool which is set to node's default maxSockets.</p>
    
    <p>pool.maxSockets - Integer containing the maximum amount of sockets in the pool.</p>
  </blockquote>
  
  <p>I have this code for writing to a CouchDB instance (note the question marks).  Basically, any user who connects to my Node server will write to the DB independent of each other:</p>
  
  <pre><code>var request = require('request');
  
  request({
      //pool:,     //  ??????????????????
      'pool.maxSockets' : 100,  //  ??????????????????
      'method' : 'PUT',
      'timeout' : 4000,
      'strictSSL' : true,
      'auth' : {
          'username' : myUsername,
          'password' : myPassword
      },
      'headers' : {
          'Content-Type': 'application/json;charset=utf-8',
          'Content-Length': myData.length
      },
      'json' : myData,
      'url': myURL
  }, function (error, response, body){
      if (error == null) {
          log('Success: ' + body);
      }
      else {
          log('Error: ' + error);
      }
  });
  </code></pre>
  
  <p>What's best for high throughput/performance?<br>
  What are the drawbacks of a high 'maxSockets' number?<br>
  How do I create a separate pool to use instead of the global pool?  Why do I only want to create a separate pool?</p>