Apache JServ Protocol (AJP)


The Apache JServ Protocol (AJP) is a binary protocol that can proxy inbound requests from a web server through to an application server

that sits behind the web server.

It also supports some monitoring in that the web server can ping the application server. Web implementors typically use AJP in a

load-balanced deployment where one or more front-end web servers feed requests into one or more application servers. Sessions

are redirected to the correct application server using a routing mechanism wherein each application server instance gets a name (

called a route). In this scenario the web server functions as a reverse proxy for the application server.

 

AJP runs in Apache HTTP Server 1.x using the mod_jk plugin and in Apache 2.x using the provided Proxy AJP, mod_proxy and proxy

balancer modules together. Implementations exist for the lighttpd 1.5, nginx, Grizzly 2.1, and the Internet Information Server.

Both the Apache Tomcat servlet container as well as the Jetty servlet container support AJP.

 

AJP是定向包協議。因為性能原因,使用二進制格式來傳輸可讀性文本。WEB服務器通過TCP連接和SERVLET容器連接。為了減少進程生成socket的花費,
WEB服務器和SERVLET容器之間嘗試保持持久性的TCP連接,對多個請求/回復循環重用一個連接。一旦連接分配給一個特定的請求,在請求處理循環結束
之前不會在分配。換句話說,在連接上,請求不是多元的。這個是連接兩端的編碼變得容易,雖然這導致在一時刻會有很多連接。
 
一旦WEB服務器打開了一個到SERVLET容器的連接,連接處於空閑狀態或已分派狀態
 
一旦一個連接被分配給一個特定的請求,在連接上發送的基本請求信息是高度壓縮的。在這點,SERVLET容器大概准備開始處理請求,當它處理的時候,
它能發回下面的信息給WEB服務器:(1)SEND_HEADERS、(2) SEND_BODY_CHUNK、(3) GET_BODY_CHUNK、(4)END_RESPONSE
 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM