title: Async http client (ning) creating more threads?
body: <p>I am using the <a href="http://sonatype.github.com/async-http-client/">ning</a> async http client to achieve the non-blocking goodness. Doing an apples vs apples test (non blocking vs blocking), I am seeing that the non blocking version is serving more request samples, however the async http client is creating more threads comparing to its blocking counterpart. Is this expected or something that I am missing? </p>
  
  <p>Here are the numbers from the stress test</p>
  
  <pre><code>Async Http Client
  jMeter - 2 threads, 120 seconds, 1 sec ramp up
  Peak threads : 270
  Heap usage: 600mb
  Peak cpu usage: 30%
  Total samples: 18228
  
  Blocking version
  jMeter - 2 threads, 120 seconds, 1 sec ramp up
  Peak threads: 118
  heap usage: 260mb
  cpu usage: 18%
  total samples: 1472
  </code></pre>
  
  <p>I am creating a thread pool of connections (reusing them) </p>
  
  <pre><code>AsyncHttpClientConfig.Builder builder = new AsyncHttpClientConfig.Builder();
  builder.setRequestTimeoutInMs(2000);
  builder.setMaximumConnectionsPerHost(10);
  builder.setMaximumConnectionsTotal(100);
  client = new AsyncHttpClient(builder.build());
  </code></pre>
  
  <p>Is there something I am missing here? I tried looking at the thread dump to see what is creating threads, but did not find anything useful. 
  My bet is that there is a thread for each http connection being spawned to fire the callback on I/O completion in the async http client.</p>