The APR based Apache Tomcat Native Library which allows optimal performance in production Environmen

Source: Internet
Author: User
Tags openssl openssl library tomcat apache tomcat freeswitch

When Tomcat starts, the first line reports the message: The APR based Apache Tomcat Native Library which allows optimal performance in production environments W As not found on the Java.library.path:c:\program files\java\jre1.6.0_05\bin;d:\java\apache-tomcat-6.0.16\ Bin is actually a Tomcat recommendation to use Apache Apr.

Workaround:
Related documents: http://tomcat.apache.org/tomcat-6.0-doc/apr.html
Go here http://tomcat.heanet.ie/native/Download the latest version of Tcnative-1.dll and put it in the Tomcat installation directory \ Bin
Then reboot tomcat to be OK.
For example, now that I have downloaded the V1.1.14 tcnative-1.dll, the boot-time information becomes:
Reference information: Loaded APR based Apache Tomcat Native library 1.1.14.
What's the effect of this Apr? Tomcat can use Apache portable Runtime to provide stronger performance, improve the processing power of Web static pages, and no longer need a dedicated Web server to handle static pages.



Tomcat consolidates the local APR to improve efficiency:
First, the time to handle static resources is faster, (note: Some people use jmeter, the use of the APR before and after the test of Tomcat, the results show that there is a certain increase in performance, but no imagination, only a little bit, of course, this is related to the logic of running, But I personally think that in most cases this part of the performance is slightly improved.
Second, I think the increase is more of the efficiency of SSL processing, when Tomcat processing HTTPS request is, if the use of the local OpenSSL library, will certainly be more efficient than the previous promotion. (although there is no actual test data, I guess the performance boost here is much higher than the 1th).

To run a local APR, you need three libraries:
* APR Library
* JNI wrappers for APR used by Tomcat (libtcnative)
* OpenSSL Libraries

To add, this is not an eclipse or a myeclipse problem, but a feature that Tomcat itself calls the local library to improve its operational efficiency. Tomcat did not find the appropriate local library to hint.


The APR (Apache portable run-time Libraries,apache Portable runtime) is designed to provide an underlying support interface library that can be used across multiple operating system platforms, as its name would be, primarily for upper-level applications.
In earlier versions of Apache, the application itself must be able to handle the details of a variety of specific operating system platforms and invoke different processing functions for different platforms. With the further development of Apache, the Apache organization decided to separate and develop these universal functions into a new project. In this way, the development of APR is isolated from Apache, and Apache uses only Apr.
Apr is mostly still used by Apache, but due to the good portability of APR, some C programs that need to be ported are also starting to use APR, open source projects such as flood loader tester (http://httpd.apache.org/test/ Flood/, the project for server stress testing, not just for Apache), FreeSwitch (www.freeswitch.org), jxta-c (Http://jxta-c.jxta.org,C version of JXTA Point-to-point platform implementation ), commercial projects include Blogline (Http://www.bloglines.com/,covalent (http://www.covalent.net) and so on. APR enables the processing of platform details to move down. For applications, they do not need to consider the specific platform, whether UNIX, Linux or window, the application execution of the interface is basically consistent. Therefore, for APR, portability and a unified upper-level interface are an important consideration. This was not the first goal of APR, but it was originally intended to merge all the code used in Apache into a common codebase, but this was not the right strategy, so the APR changed its target later. Sometimes it is not a good thing to use public code, such as how to map a request to a thread or a process that is platform-dependent, so a common code base does not make this distinction.
The goal of APR is to safely merge all the code that can be merged without sacrificing performance. One of the first goals of APR is to provide a common, unified Operation function interface for all platforms (not parts), which is a great goal, and certainly unrealistic. We can't support all the features of all platforms, so APR is currently available for all APR feature support for most platforms, including Win32, OS/2, BeOS, Darwin, Linux, and more. In order to achieve this goal, APR developers must create a series of feature macros (FEATURE MACROS) for those features that cannot be run on all platforms to differentiate between the various platforms. These feature macro definitions are very simple, usually as follows: Apr_has_feature If a platform has this feature, the macro must be set to true, such as Linux and Windows have a memory-mapped file, and APR provides the operating interface of the memory-mapped file. So on these two platforms, the APR_HAS_MMAP macro must be set, and the ap_mmap_* function should map the disk file to memory and return the appropriate status code. If your operating system does not support memory mapping, then Apr_has_mmap must be set to 0, and all ap_mmap_* functions may not need to be defined. The second step is to warn those who use unsupported functions in the program.
Basic types supported in APR
Folder name Description
Atomic/srclib/apr/atomic Atomic operation
DSO/SRCLIB/APR/DSO Dynamically loading shared libraries
Fileio/srclib/apr/file_io File IO Processing
Mmap/srclib/apr/mmap memory-Mapped files
Locks/srclib/apr/locks process and Thread mutexes
Memory/srclib/apr/memory Memory Pool Operations
Network_io/srclib/apr/network_io Network IO Processing
Poll/srclib/apr/poll Polling IO
Table/srclib/apr/tables Apache Arrays (stacks) and tables and hash tables
Process/srclib/apr/threadproc Process and threading operations
User/srclib/apr/user User and user group operations
Time/srclib/apr/time time operation
String/srclib/apr/strings string manipulation
PASSWORD/SRCLIB/APR/PASSWD Terminal password processing
Misc/srclib/apr/misc a hodgepodge of any APR types that are not part of the rest of the class can be placed inside
Shmem/srclib/apr/shmem Shared Memory
Random/srclib/apr/random Random number Generation Library

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.