I was studying about the infrastructure being used by Facebook, as I was developing a website based on social interaction for a university project.

Facebook is using Tornado Web Server as its scalable, non-blocking web server, but it's written for Python. I'm trying to find something similar for Java: what should I be looking at? What are your experiences in non-blocking web servers for Java?


3 Answers 3



Netty is a high performance event-driven network framework that has support for HTTP and other common protocols. Netty uses non-blocking I/O. But it's pretty low level to use.

Play Framework

Play Framework is a modern web framework for both Java and Scala. It has a very short development cycle - just save your file and update your browser. It's inspired by Ruby on Rails. Play Framework is by default based on Netty (embedded), but it can also be used in a Java Servlet container as a war-file.

I have been using Play Framework in a few months. It's a framework that is easy to use and it has very good performance since it's based on Netty. If you have done some GUI programming e.g. using Swing then you have done event-driven programming before and it's the same principles: Do all long-running processing in a background thread, otherwise your server will be blocked like a GUI is blocked when the thread is used incorrectly.


You can use ngnix as a proxy in front of a java container. The problem that Tornado and ngnix solves is that the io on the sockets is event driven instead of blocking, which limits your standing connections to something like 10,000. In a java environment you can use ngnix as a reverse proxy/load balancer for one or more java containers and achieve similiar scalability. There are projects like netty from jboss that are starting to address this problem for the java space, but I'm not sure if there are any commercial implementations using it.


There has been some activity around building a web server on top of Apache Mina, but I'm not sure how far along it is. The webpage is currently pretty light on details.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.