Chapter 5. Scaling Comet in Java
You've now seen how DWR integrates with Java applications to implement server push using Comet. But we haven't yet addressed scaling. In this chapter, we'll begin by examining why traditional web servers scale poorly to the demands of a Comet application. We'll then look at the Jetty server, which offers an alternative approach to serving Comet requests, and demonstrate how to write scalable Comet applications using this proprietary approach.
Thread Management for the Web
As you saw earlier in this book, traditional servers allocate a thread to each incoming HTTP request. The idea is that the thread should perform any necessary work to service the request and send a response as quickly as possible, after which it ...