The Apache Tomcat Connector - AJP Protocol Reference

The original document was written by Dan Milstein, [email protected] on December 2000. The present document is generated out of an xml file to allow a more easy integration in the Tomcat documentation.

This describes the Apache JServ Protocol version 1.3 (hereafter ajp13). There is, apparently, no current documentation of how the protocol works. This document is an attempt to remedy that, in order to make life easier for maintainers of JK, and for anyone who wants to port the protocol somewhere (into jakarta 4.x, for example).

AJP是定向包协议。因为性能原因,使用二进制格式来传输可读性文本。WEB服务器通过TCP连接和SERVLET容器连接。为了减少进程生成socket的花费,WEB服务器和SERVLET容器之间尝试保持持久性的TCP连接,对多个请求/回复循环重用一个连接。一旦连接分配给一个特定的请求,在请求处理循环 结束之前不会在分配。换句话说,在连接上,请求不是多元的。这个是连接两端的编码变得容易,虽然这导致在一时刻会有很多连接。
  一旦WEB服务器打开了一个到SERVLET容器的连接,连接处于下面的状态:
  ◆ 空闲
  这个连接上没有处理的请求。
  ◆ 已分派
  连接正在处理特定的请求。
  一旦一个连接被分配给一个特定的请求,在连接上发送的基本请求信息是高度压缩的。在这点,SERVLET容器大概准备开始处理请求,当它处理的时候,它能发回下面的信息给WEB服务器:
  ◆ SEND_HEADERS
  发送一组头到浏览器。
  ◆ SEND_BODY_CHUNK
  发送一块主体数据到浏览器。
  ◆ GET_BODY_CHUNK
  从请求获得下一个数据如果还没有全部传输完,如果请求内容的包长度非常大或者长度不确定,这是非常必要的。例如上载文件。注意这和HTTP的 块传输没有关联。
  ◆ END_RESPONSE
  结束请求处理循环。

http://baike.so.com/doc/1893474.html

http://tomcat.apache.org/connectors-doc/ajp/ajpv13a.html

http://tomcat.apache.org/tomcat-3.3-doc/mod_jk-howto.html

http://tomcat.apache.org/tomcat-6.0-doc/cluster-howto.html

猜你喜欢

转载自oywl2008.iteye.com/blog/2078817