Apache JServ: Faster, Safer Servlets
By Lincoln D. Stein
Back in my November 1996 column
"Server Scripts: Can They Keep Up?" I discussed FastCGI, a protocol that speeds up CGI scripts tremendously by running them continuously in a separate process. More recently, I experimented briefly with Java servlets, an API for extending the Web server's capabilities with small modules of Java code (see "Java Servlets: Back to the Future," April 1998). But what about combining the flexibility of both? Well, I recently had a look at Apache JServ, a servlet engine designed to work with the Apache Web server for both UNIX and Windows NT. It combines the best features of FastCGI with the Java servlet API, and the results are compelling.
With few exceptions, servlet engines take one of two approaches. Either they embed a Java virtual machine (JVM) in a Web server written in C or another compiled language, or they simply write the whole Web server in Java. The approaches are similar in that the servlet engine and the Web server are combined together into a single process. But both approaches have some disadvantages. When Java is used as a Web server, performance on static pages suffers because interpreted Java is simply never as fast as compiled C. When servlets written by several authors run in the same Java process, there's a risk that they'll interfere with one another by calling each other's public methods or changing their instance variables.
Apache JServ takes a third approach by splitting the job into two parts.