Building Highly Scalable Servers with Java NIO


News: Building Highly Scalable Servers with Java NIO

  1. Building Highly Scalable Servers with Java NIO (4 messages)

    Nuno Santos discusses a recent project that he was on, in which he had to build a single router that could handle at least 3,000 simultaneous connections. Nuno talks about the various strategies you could use, and how the software evolved over time.

    Developing a fully functional router based on I/O multiplexing was not simple. It took us three months to get the architecture right. Part of this time was spent learning an unfamiliar I/O model. The other part was spent dealing with its inherent complexity. In the end, we were quite happy with the results. In internal benchmarks, the router was able to handle up to 10,000 clients with no significant drop in throughput. For comparison, we implemented a version based on the thread-per-client model, which was only able to reach 3,000 clients, with a significant drop in throughput as the number of clients increased.

    Should you use I/O multiplexing in your next server? It depends. If the number of simultaneous clients will never exceed more than one or two hundred, then go for a simpler threaded model. But if you plan to support hundreds or even thousands of simultaneous clients, you should definitely consider using I/O multiplexing. If you do use it, we hope this article and the companion source code will help you avoid some of pitfalls of using I/O multiplexing with Java NIO.
    Read the full article: Building Highly Scalable Servers with Java NIO

    Threaded Messages (4)

  2. C10K Problem[ Go to top ]

    This page is very relevant:
  3. When using the multithreaded model I observed a 10% drop in throughput when handling 500 client connections. So indeed no need to use NIO if your server only needs to handle just a couple hundred connections.

    The Iris server is an RPC Java solution implemented with NIO:
  4. How about Coconut AIO[ Go to top ]

    In cominng up with the NIO solution for I/O Multiplexing, have you considiered the alternative of makking use of something like the Coconut AIO ?

    How do they compare ?
  5. you might want to look at seda[ Go to top ]

    It talks about high performance architectures.