关于Apache Portable Runtime and Tomcat
在从Tomcat 5.0.28转向5.5.X时,在启动时发现出现如下信息
[org.apache.catalina.core.AprLifecycleListener]-[INFO] The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: (...你的系统环境PATH路径...)
在停止时发现出现如下信息
[org.apache.catalina.core.AprLifecycleListener]-[INFO] Failed shutdown of Apache Portable Runtime
于是,想消除这个问题,通过查阅 http://tomcat.apache.org/tomcat-5.5-doc/apr.html
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.
发现 Tomcat 可以用 Apache Portable Runtime 来提供更强性能,提升Web静态页面的处理能力,不再需要专门的Web Server来处理静态页面了。
但是APR的支持需要安装三个本地组件
APR support requires three main native components to be installed:
1、APR library
2、JNI wrappers for APR used by Tomcat (libtcnative)
3、OpenSSL libraries
解决:Windows下的安装配置与使用
1、先去 http://tomcat.heanet.ie/native/ 下载编译好的 tcnative-1.dll 文件,也可以下载tomcat-native.zip自己进行编译
2、修改一下 catalina.bat,加上
set CATALINA_OPTS="-Djava.library.path=../../APR/lib"
因为我把这个DLL放在与Tomcat目录同级的APR/lib目录下,所以采用了相对路径。或者把dll加到你的系统变量PATH里之类的,最简单的方法应当就是把tcnative-1.dll文件放在Tomcat的bin目录下:)
这样设置后,启动可以看到信息如下:
[org.apache.coyote.http11.Http11AprProtocol]-[INFO] Initializing Coyote HTTP/1.1 on http-9091
在停止时发现出现如下信息
[org.apache.coyote.http11.Http11AprProtocol]-[INFO] Pausing Coyote HTTP/1.1 on http-9091
......
[org.apache.coyote.http11.Http11AprProtocol]-[INFO] Stopping Coyote HTTP/1.1 on http-9091
这样就配置成功了。性能方面目前没有做详细的测试。
======================================================================
相关的文档参见
http://tomcat.apache.org/tomcat-5.5-doc/apr.html
相关的性能测试结果参见
http://www.javaworld.com.tw/jute/post/view?bid=9&id=139958&sty=3&age=0
分享到:
相关推荐
apr sdk vs2015 winsdk8,1包含x86/x64 apr/apr-util/apr-iconv/expat 第一次传得缺了东西,又不知道怎么取消 重新上传一份
the Apache Portable Runtime (APR) project is to create and maintain software libraries that provide a predictable and consistent interface to underlying platform-specific implementations. The primary ...
Apache Portable Runtime Project apr 包含32/64的apr、apr-iconv、32位expat、32位apr-util 由vs2015编译,由于底层expat直接下的 导致aprutil只编译出了32位版本,其他的apr、apr-iconv包含x86、x64两个版本
. eclipse 4.1 导入项目后 Target runtime Apache Tomcat v6.0 is not defined
aprAPI 文档,从apache.org获取
aprAPI 文档 ,从apache.org获取
NULL 博文链接:https://huanyue.iteye.com/blog/479413
Apache tomcat6.0 java开发工具 Apache tomcat6.0 Apache tomcat6.0
开发工具 apache-tomcat-8.0.41-windows-x86开发工具 apache-tomcat-8.0.41-windows-x86开发工具 apache-tomcat-8.0.41-windows-x86开发工具 apache-tomcat-8.0.41-windows-x86开发工具 apache-tomcat-8.0.41-...
Apache Tomcat 软件是Jakarta Servlet、 Jakarta Server Pages、 Jakarta Expression Language、 Jakarta WebSocket、 Jakarta Annotations和 Jakarta Authentication 规范的开源实现 。 压缩包内容: apache-...
TomCat Apache 整合TomCat Apache 整合TomCat Apache 整合TomCat Apache 整合TomCat Apache 整合TomCat Apache 整合
apache-tomcat-7.0.53apache-tomcat-7.0.53apache-tomcat-7.0.53apache-tomcat-7.0.53
Tomcat是Apache 软件基金会(Apache Software Foundation)的Jakarta 项目中的一个核心项目,由Apache、Sun 和其他一些公司及个人共同开发而成。由于有了Sun 的参与和支持,最新的Servlet 和JSP 规范总是能在Tomcat ...
Apache+JK+Tomcat搭建负载均衡 适用于32和64位操作系统
Tomcat是由Apache软件基金会下属的Jakarta项目开发的一个Servlet容器,按照Sun Microsystems提供的技术规范,实现了对Servlet和JavaServer Page(JSP)的支持,并提供了作为Web服务器的一些特有功能,如Tomcat管理和...
apache-tomcat-9.0.45-windows-x64apache-tomcat-9.0.45-windows-x64apache-tomcat-9.0.45-windows-x64apache-tomcat-9.0.45-windows-x64apache-tomcat-9.0.45-windows-x64apache-tomcat-9.0.45-windows-x64apache-...
Apache与多个Tomcat服务器集成时的负载平衡.txt
Apache Tomcat is an open source software implementation of the Java Servlet and JavaServer Pages technologies. The Java Servlet and JavaServer Pages specifications are developed under the Java ...
配置安装Apache+Apache Tomcat实现tomcat负载均衡教程.doc
Apache Tomcat 最新源代码Apache Tomcat 最新源代码Apache Tomcat 最新源代码Apache Tomcat 最新源代码Apache Tomcat 最新源代码Apache Tomcat 最新源代码Apache Tomcat 最新源代码Apache Tomcat 最新源代码Apache ...