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 ...

Get Comet and Reverse Ajax: The Next-Generation Ajax 2.0 now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.