title: Fast NIO, asynchronous HTTP Server for Java
body: <p>Following on <a href="https://stackoverflow.com/questions/1133156/simple-java-stand-alone-server-container-framework">this question</a> I am actually in the phase of finding the right HTTP container for one of my projects, too. I looked at several containers but I'm still not sure which one will be best suited for high load AJAX only requests. <a href="http://mina.apache.org" rel="nofollow noreferrer">Apache Mina</a> looks quite promising, but relatively complex as well. The asynchronous web server implementation called AsyncWeb seems to have been merged with Mina but I couldn't find any production relase of it, yet. In the other question I recommended the <a href="http://www.simpleframework.org/" rel="nofollow noreferrer">Simple HTTP</a> server which I really like because it is... well simple, clear and clean but I still don't know if it would fit the purpose.</p>
  
  <p>Additionally I'm not sure on which request handling concept to choose:</p>
  
  <ol>
  <li><p>Create a dispatcher Thread for every incoming connection (optimizations might of course include a thread pool and a dispatching queue), that is doing all the work. The advantage is probably, that I don't have to deal with that many synchronisation issues but it will probably lower the throughput on high loads drastically.</p></li>
  <li><p>Because it is going to be a highly modular application a "pipelining" (there might be a more fitting term I guess ;) approach might work as well: Create a fixed number of Threads, each for a certain task.
  E.g. one for request handling -> one for header deserialization (if I get input in different formats like subtmitted HTML Forms, XML-RPCs, JSON etc.) -> one for "Controller Dispatching" (doing whatever I want to do with these data) -> and one for serializing the output in the desired format (JSON, XML, HTML etc.) and move every request through these levels until it is completed. Probably more difficult to realize but I have a fixed number of Threads (the number can dependend on the hardware as well) and a clean separation of concerns.</p></li>
  </ol>
  
  <p>Any experiences with any Framework that might fit and the two different handling approaches?</p>