title: TNonblockingServer, TThreadedServer and TThreadPoolServer, which one fits best for my case?
body: <p>Our analytic server is written in c++. It basically queries underlying storage engine and returns a fairly big structured data via thrift.  A typical requests will take about 0.05 to 0.6 seconds to finish depends on the request size.</p>
  
  <p>I noticed that there are a few options in terms of which Thrift server we can use in the c++ code, specifically TNonblockingServer, TThreadedServer, and TThreadPoolServer. It seems like TNonblockingServer is the way to go since it can support much more concurrent requests and still using a thread pool behind the scene to crunch through the tasks. It also avoids the cost of constructing/destructing the threads.</p>
  
  <p>Facebook's update on thrift: <a href="http://www.facebook.com/note.php?note_id=16787213919" rel="nofollow noreferrer">http://www.facebook.com/note.php?note_id=16787213919</a></p>
  
  <blockquote>
    <p>Here at Facebook, we're working on a fully asynchronous client and server for C++. This 
    server uses event-driven I/O like the current TNonblockingServer, but its interface to 
    the application code is all based on asynchronous callbacks. This will allow us to write 
    servers that can service thousands of simultaneous requests (each of which requires 
    making calls to other Thrift or Memcache servers) with only a few threads.</p>
  </blockquote>
  
  <p>Related posts on stackover: <a href="https://stackoverflow.com/questions/954945/large-number-of-simulteneous-connections-in-thrift">Large number of simulteneous connections in thrift</a></p>
  
  <blockquote>
    <p>That being said, you won't necessarily be able to actually do work faster (handlers 
    still execute in a thread pool), but more clients will be able to connect to you at once.</p>
  </blockquote>
  
  <p>Just wondering are there any other factors I'm missing here? How shall I decide which one fits my needs the best?</p>