This article describes APR (APACHE portal runtime) and tomcat.
1. Apr comes from the Apache project and is a core module in Apache 2.x. Using APR in Tomcat can greatly improve performance and improve scalability. Because ARP uses many native methods, such as sendfile (using sendfile allows users to download large files) and epoll (in Linux ). Here is the original description:
Tomcat can use the Apache Portable Runtime to provide superior scalability, performance, and better integration with native server technologies. the Apache Portable Runtime is a highly portable library that is at the heart of Apache HTTP Server 2. x. APR has passed uses, including access to advanced Io functionality (such as sendfile, epoll and OpenSSL), OS level functionality (Random Number Generation, system status, etc ), and native process handling (shared memory, NT pipes and Unix sockets ).
2. Configure APR in Tomcat. in Linux, manually compile the tomcat-native.tar.gz package in the $ catalina_home/bindirectory. Compiling this package is very simple. You can use configure, make, and make install. However, when compiling this package, you must first install the following:
APR 1.2 + Development headers (libapr1-dev package)
OpenSSL 0.9.7 + Development headers (libssl-dev package)
JNI headers from Java compatible JDK 1.4 +
GNU Development Environment (GCC, make)
I have no labs here. If necessary, I can come back to experiment with this Apr.
3. after the above packages are compiled, some libraries will be generated. If these libraries can be found by Tomcat Connector (if Tomcat cannot be found, the path to the library will be printed ), the connector automatically becomes the connector of APR enable to provide high performance. The second half of this document is about some additional configurations in ctor after APR enable. If you are interested, please refer to this document directly, including the additional configurations of SSL ctor in Apr.