The tomcat AJP (packet oriented protocol) protocol

Because tomcat and pictures of html parsing as compared to other servers and other apche weak, so are generally integrate use, only referred to tomcat jsp and servlet service processing, and integrated tomcat and other servers, is done by ajp agreement of.

The official description:

http://tomcat.apache.org/tomcat-8.0-doc/config/ajp.html

 

 

 

 

AJP protocol 

AJP13 is oriented packet protocol. For performance reasons, to transfer the readability of text using a binary format. WEB server via a TCP connection and SERVLET container. In order to reduce the cost of the process of creating the socket, attempts to maintain persistent TCP connection between the server and the WEB SERVLET container, a plurality of request / reply cycle reuse a connection. Once the connection is assigned to a specific request, not allocated in the request before the end of the processing cycle. In other words, the connection request is not diverse. This is connected to both ends of the coding easier, although this results in a moment there will be a lot of connections. Once the WEB server opens a connection to SERVLET container, connected in the following state: 
◆ idle 
this is not the connection request processing. 
◆ dispatched 
connected to a specific request is being processed. 


一旦一个连接被分配给一个特定的请求,在连接上发送的基本请求信息是高度压缩的。在这点,SERVLET容器大概准备开始处理请求,当它处理的时候,它能发回下面的信息给WEB服务器: 
◆ SEND_HEADERS 
发送一组头到浏览器。 
◆ SEND_BODY_CHUNK 
发送一块主体数据到浏览器。 
◆ GET_BODY_CHUNK 
从请求获得下一个数据如果还没有全部传输完,如果请求内容的包长度非常大或者长度不确定,这是非常必要的。例如上载文件。注意这和HTTP的块传输没有关联。 
◆ END_RESPONSE 
结束请求处理循环。

 

HTTP 连接器是 Tomcat 默认配置好的,可立即使用。该连接器能实现最低的延时以及最佳的整体性能。对于集群化来说,必须安装支持 Web 会话粘性的 HTTP 负载均衡器,以便将流量导引至多个 Tomcat 服务器上。Tomcat 支持将 mod_proxy 模块(可加载到 Apache HTTP server 2.0 中,到了 Apache HTTP server 2.2 时,成为默认包含的模块。)用作负载均衡器。 不过要注意的是,HTTP 代理的性能往往要低于 AJP,所以 AJP 集群化才是首选方式。 

 

2. AJP Connector

The AJP Connector element represents a Connector component that communicates with a web connector via the AJP protocol.
AJP连接器可以通过AJP协议和一个web容器进行交互

This is used for cases where you wish to invisibly integrate Tomcat into an existing (or new)Apache installation, and you want Apache to handle the static content contained in the web application, and/or utilize Apache’s SSL processing.
当你想让Apache和Tomcat结合并且你想让Apache处理静态内容的时候用AJP,或者你想利用Apache的SSL处理能力时

This connector supports load balancing when used in conjunction with the jvmRoute attribute of the Engine.
特殊于HTTP Connector,AJP还可以与engine元素上的jvmRoute结合使用来实现负载均衡功能

我看的tomcat8.0.30的版本的AJP连接器支持JK 1.2.X和mode_proxy(on Apache httpd 2.x)两种方式与其他web容器交互(一般使用Apache HTTP Server)
--------------------- 

Guess you like

Origin www.cnblogs.com/guanghuiqq/p/11204719.html