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

Get Tomcat: The Definitive Guide, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.