Apr (Apache portable Runtime/apache Portable runtime) is the support library for Apache HTTP servers. You can simply understand that Tomcat will invoke the core dynamic link Library of the Apache HTTP server in the form of JNI to handle file reads or network transfer operations, thus greatly improving the performance of Tomcat's handling of static files. Tomcat APR is also the preferred mode for running high concurrent applications on Tomcat.
The configuration of Tomcat Apr run mode is relatively cumbersome. As stated in the official documentation, Tomcat APR requires support for the following three components:
1. APR LIBRARY[APR Library]
2. JNI wrappers for APR used by Tomcat (libtcnative) [Simply, if it is on the Windows operating system, it is a dynamic link library file called Tcnative-1.dll]
3. OpenSSL Libraries[openssl Library]
In addition, as with the NIO run mode, you need to change the Protocol property value of the corresponding connector node to Org.apache.coyote.http11.Http11AprProtocol. However, the above is only required in earlier versions of the configuration, the new version, if 9.0, the default is already Apr mode, it is recommended that users tomcat the latest version.
On Windows, the APR mode is dependent on the Tcnative-1.dll dynamic library, which is already included in version 9.0, and if it does not exist, it needs to download the configuration itself.
Basic steps:
1, download from http://archive.apache.org/dist/tomcat/tomcat-connectors/native/website;
2. Copy the Tcnative-1.dll of Tomcat to the bin directory;
3, start if the following content appears, the APR loaded successfully.
Tomcat Apr Mode Open method