title: How to handle upwards of a million concurrent clients on a single Java server?
body: <p>I am building a NIO Java TCP server that is to be able to hold up to one million concurrent clients. It unfortunately has to be TCP connections.</p>
  
  <p>What are some practices to achieve this? I am taking inspiration from the Node.JS processing model (and, I suppose, the classical NIO approach): namely one event loop thread and worker threads for off-loading long-running tasks.</p>
  
  <p>I've read about people achieving over a million concurrent connections. However, how is it possible to have the number of open sockets exceed the number of ports available? What about the limit of the number of open files in the operating system?</p>