konhon

          忘掉過去,展望未來。找回自我,超越自我。
          逃避不一定躲的過, 面對(duì)不一定最難過, 孤單不一定不快樂, 得到不一定能長(zhǎng)久, 失去不一定不再擁有, 可能因?yàn)槟硞€(gè)理由而傷心難過, 但我卻能找個(gè)理由讓自己快樂.

          Google

          BlogJava 首頁(yè) 新隨筆 聯(lián)系 聚合 管理
            203 Posts :: 0 Stories :: 61 Comments :: 0 Trackbacks

          關(guān)于Apache Portable Runtime and Tomcat- -

          ??????????????????????????????????????

          關(guān)于Apache Portable Runtime and Tomcat

          在從Tomcat 5.0.28轉(zhuǎn)向5.5.X時(shí),在啟動(dòng)時(shí)發(fā)現(xiàn)出現(xiàn)如下信息
          [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: (...你的系統(tǒng)環(huán)境PATH路徑...)

          在停止時(shí)發(fā)現(xiàn)出現(xiàn)如下信息
          [org.apache.catalina.core.AprLifecycleListener]-[INFO] Failed shutdown of Apache Portable Runtime

          于是,想消除這個(gè)問題,通過查閱 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.

          發(fā)現(xiàn) Tomcat 可以用 Apache Portable Runtime 來提供更強(qiáng)性能,提升Web靜態(tài)頁(yè)面的處理能力,不再需要專門的Web Server來處理靜態(tài)頁(yè)面了。

          但是APR的支持需要安裝三個(gè)本地組件
          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自己進(jìn)行編譯
          2、修改一下 catalina.bat,加上
            set CATALINA_OPTS="-Djava.library.path=../../APR/lib"
          因?yàn)槲野堰@個(gè)DLL放在與Tomcat目錄同級(jí)的APR/lib目錄下,所以采用了相對(duì)路徑。或者把dll加到你的系統(tǒng)變量PATH里之類的,最簡(jiǎn)單的方法應(yīng)當(dāng)就是把tcnative-1.dll文件放在Tomcat的bin目錄下:)

          這樣設(shè)置后,啟動(dòng)可以看到信息如下:
          [org.apache.coyote.http11.Http11AprProtocol]-[INFO] Initializing Coyote HTTP/1.1 on http-9091
          在停止時(shí)發(fā)現(xiàn)出現(xiàn)如下信息
          [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

          這樣就配置成功了。性能方面目前沒有做詳細(xì)的測(cè)試。
          ======================================================================
          相關(guān)的文檔參見
          http://tomcat.apache.org/tomcat-5.5-doc/apr.html

          相關(guān)的性能測(cè)試結(jié)果參見
          http://www.javaworld.com.tw/jute/post/view?bid=9&id=139958&sty=3&age=0

          posted on 2006-11-27 20:29 konhon 優(yōu)華 閱讀(2975) 評(píng)論(0)  編輯  收藏

          只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 洪泽县| 上饶县| 合江县| 峡江县| 五寨县| 东乌珠穆沁旗| 延吉市| 广水市| 阆中市| 济宁市| 满城县| 高尔夫| 龙门县| 修水县| 岚皋县| 宜阳县| 甘泉县| 高密市| 千阳县| 台州市| 遵义市| 新源县| 铅山县| 灵山县| 财经| 衡水市| 修武县| 宜阳县| 淮滨县| 施甸县| 察哈| 镇坪县| 巩留县| 瑞丽市| 澄城县| 南雄市| 嘉祥县| 盘锦市| 久治县| 炉霍县| 福鼎市|