O'Reilly logo

Tomcat: The Definitive Guide, 2nd Edition by Ian F. Darwin, Jason Brittain

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Tomcat Serving HTTP over the APR Connector

Starting in Tomcat 5.5, Tomcat comes with another web server implementation called the APR connector. It is implemented in both the Java and C programming languages. The main goals of the APR connector are high performance and scalability, with the ability to easily integrate with other C/C++ code, while still offering at least as many features as Tomcat's JIO connector (by implementing the low-level network code as open source C code, as opposed to using the Java VM's built-in networking code). APR stands for Apache Portable Runtime, which is a separate open source project, whose stated goal is to "provide an API to which software developers may code and be assured of predictable if not identical behavior regardless of the platform on which their software is built." In short, APR is a native library that implements several low-level features that a network server such as Apache httpd or Tomcat can take advantage of. In fact, Apache httpd is built on top of APR—httpd's low-level network code is APR. For more information about the APR project, see the APR home page at http://apr.apache.org.

Here are some reasons for using the APR connector instead of either the JIO or NIO connectors:

  • HTTPS may be faster using the APR connector because the APR connector is native code that calls the OpenSSL library. The JIO and NIO connectors are pure Java and use the pure Java TLS/SSL code, which is known to be somewhat slower than OpenSSL. If you are not ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required