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

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