本文講述APR(Apache Portal Runtime)和Tomcat.?
1. APR來源自apache項目,是apache 2.x中的一個核心模塊。在Tomcat中使用APR,能帶來性能的很大提升和高擴展性。因為ARP是使用很多native的方法,比如sendfile(使用sendfile就可以讓用戶下載大文件),epoll等(Linux系統下)。這里是原文的描述:?
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).?
2. 在Tomcat下配置APR,在Linux系統下,首先要手動編譯位于$CATALINA_HOME/bin目錄下的tomcat-native.tar.gz包。編譯這個包非常簡單,configure, make, make install即可。不過在編譯這個包的時候,需要首先安裝如下的東西:?
這里我沒有實驗,如果有需要的話將來可以回來實驗這個APR。?
3. 當上述的包編譯完成后,就會生成一些library,如果這些library能被tomcat的connector找到(如果找不到tomcat會打印尋找library的路徑),那么connector就會自動變成APR enable的connector,從而提供高性能。文檔的后半部分主要是在講述APR enable之后的connector中的一些額外配置,有興趣請直接參考文檔,包括SSL的connector在APR下要做哪些額外的配置等。
1. APR來源自apache項目,是apache 2.x中的一個核心模塊。在Tomcat中使用APR,能帶來性能的很大提升和高擴展性。因為ARP是使用很多native的方法,比如sendfile(使用sendfile就可以讓用戶下載大文件),epoll等(Linux系統下)。這里是原文的描述:?
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).?
2. 在Tomcat下配置APR,在Linux系統下,首先要手動編譯位于$CATALINA_HOME/bin目錄下的tomcat-native.tar.gz包。編譯這個包非常簡單,configure, make, make install即可。不過在編譯這個包的時候,需要首先安裝如下的東西:?
-
APR 1.2+ development headers (libapr1-dev package)?
OpenSSL 0.9.7+ development headers (libssl-dev package)?
JNI headers from Java compatible JDK 1.4+?
GNU development environment (gcc, make)
這里我沒有實驗,如果有需要的話將來可以回來實驗這個APR。?
3. 當上述的包編譯完成后,就會生成一些library,如果這些library能被tomcat的connector找到(如果找不到tomcat會打印尋找library的路徑),那么connector就會自動變成APR enable的connector,從而提供高性能。文檔的后半部分主要是在講述APR enable之后的connector中的一些額外配置,有興趣請直接參考文檔,包括SSL的connector在APR下要做哪些額外的配置等。
更多文章、技術交流、商務合作、聯系博主
微信掃碼或搜索:z360901061

微信掃一掃加我為好友
QQ號聯系: 360901061
您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對您有幫助就好】元
