Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the benefit (if any) of using APR with Tomcat?

Tomcat has an option to use APR for handling connections. What are the benefits of using that? Does anyone have firsthand experience with it?

like image 213
Marko Avatar asked Apr 15 '09 10:04

Marko


People also ask

What is APR in Tomcat?

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.

What is APR native connector?

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.

What is the advantage of Apache Tomcat?

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.

What is Apache Tomcat Native?

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.


2 Answers

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)

like image 82
Brian Agnew Avatar answered Dec 03 '22 13:12

Brian Agnew


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.

like image 23
cherouvim Avatar answered Dec 03 '22 13:12

cherouvim