Tomcat has an option to use APR for handling connections. What are the benefits of using that? Does anyone have firsthand experience with it?
Introduction. 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.
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.
Apache Tomcat implements Java Servlet, JavaServer Pages (JSP), and the WebSockets Application Programming Interface (API). Essentially, it's a pure Java HTTP web server that enables Java code, and thus gives your website more cross-platform freedom than some of its alternatives.
Introduction. The Apache Tomcat Native Library is an optional component for use with Apache Tomcat that allows Tomcat to use OpenSSL as a replacement for JSSE to support TLS connections.
Does this answer yor question re. benefits?
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 many 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).
These features allows making Tomcat a general purpose webserver, will enable much better integration with other native web technologies, and overall make Java much more viable as a full fledged webserver platform rather than simply a backend focused technology.
(my emphasis)
If you don't plan to use a web server (for serving static content) in front of Tomcat then APR is supposed to improve things.
I've only indirectly used it via JBoss Web but I always prefer to have an Apache httpd fronting Tomcat, so I think APR then is irrelevant.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With