- 浏览: 853972 次
- 性别:
- 来自: 北京
文章分类
最新评论
-
zjhzwx1212:
为什么用threadLocal后,输出值是从20开始的,而定义 ...
j2ee的线程安全--threadlocal -
aeoluspu:
不错 mysql 测试部分感觉不详细
用sysbench(或者super-smack)测试mysql性能 -
nanPrivate:
有没有例子,只理论,实践起来还是不会啊
JMS可靠消息传送 -
lwclover:
一个网络工程师 装什么b
postfix 如何删除队列中的邮件 -
maimode:
我也欠缺不少啊
理想的计算机科学知识体系
Introduction
Apache 2.2 ships with advanced mod_proxy set of modules that have some of the mod_jk capabilities namely AJP protocol and integrated load balancer.
AJP (Apache Jserv Protocol) with it's current version 1.3 is constant binary protocol. Constant means that the connection between web server and application server is presumed to stay open once established for the system lifetime.
This in essence makes web server and application server a single system from the users point of view.
Since there is always a chance that one of the points in the system can fail for various reasons, the mod_proxy and mod_jk as well as the application server must have some sort of connection and transport channel error detection, and act accordingly.
One of the main technological advances in mod_jk during the past few years was made in that area, and there are various techniques for communication channel error detection and recovery. At present date mod_jk is far more advanced in that area compared with mod_proxy.
Protocol
The foundation of mod_jk is AJP protocol, that is sometimes known as binary http protocol. The point beside the custom binary protocol is that the client request data is already decoded inside web server, so there is no need for doubling that procedure in the application server as well. Next, the standard request and response headers are passed as atoms in a form of two byte sequence instead as strings, thus lowering down the network traffic between web and application server.
However there is one major limitation of the AJP protocol, and that is it's maximum packet size. The packet size is limited to little bit less then 8K. With latest mod_jk and Tomcat versions the packet size can be enlarged to 64K, but it's still limited. Mod_proxy still has no such capability, so it's maximum packet size is 8K. This can be problem with large client requests, especially with some custom SSO modules that store huge session data inside cookies or custom headers. In case there is a need to support the huge client requests, the only solution is to use http in favor of AJP protocol.
Encryption and SSL support
AJP protocol is not encrypted, so it should not be used with public network infrastructure. In case there is a need for securing the data transfer between web and application server because the transport media could be sniffed by outside world, then some sort of SSL tunnel must be used. The other option is to use the https protocol with mod_proxy. However using https protocol makes things a little bit more complex because one must assure to write the custom Filter in application server so that client certificates get passed transparently to the application server. AJP protocol on the other hand handles this automatically, but with the consequence of passing decrypted data between web and application server. In essence for SSL, the AJP protocol behaves like caching SSL accelerator.
This offers much higher performance because data is only decrypted once. Securing the network between web and application server by using a different network card and set of firewalls and routers is the most secure solution.
One other option is to put the web and application server on the same physical box in which case the in-memory communication will be used thus increasing the security of the entire system.
Load balancing
Recent versions of mod_jk have much advanced load balancer when compared to mod_proxy_balancer. Mod_jk has additional 'by busyness' method that load balance according to the actual application server response time.
Mod_jk also has so called load balancer maintenance to be able to handle the burst load more effectively or to decay the load to the node that was down for maintenance.
In cases where there is a need for large amount of application servers and session replication mod_jk has so called 'Domain Model Clustering' that supports new JBoss Cache's buddy replication. In essence it allows to lower down the session replication data transfer by grouping the nodes in the clusters, and doing the replication only between the members of the cluster.
Apache Httpd versions
New mod_proxy is present only with Apache httpd versions 2.2 and up. This means that the web server upgrade will be needed in case there is a need for a new mod_proxy.
Use worker-mpm with Apache httpd. Using worker mpm both mod_proxy and mod_jk have the option to tune the connection pool size between web and application server. This is needed in deployments where the Apache httpd is used to deliver some other content beside just fronting application server. For example delivering static content etc. In those cases the actual number of requests to the application server can be lower then the total number of client connections that needs to be handled by the web server. In this case the worker mpm allow to have the connection pool size lower then the number of MaxThreadsPerChild.
Windows and Netware Apache httpd versions are completely threaded, so their mpm and connection pool size can be handled in much wider range.
mod_proxy vs. mod_jk
So what to use when? It depends on your topology. In case you already have or need Apache 2.2 functionality you have the choice to choose between mod_proxy and mod_jk. Mod_jk works very well on Apache 2.2, so it all depends on the functionality needed:
mod_proxy
Pros:
No need for a separate module compilation and maintenance. mod_proxy, mod_proxy_http, mod_proxy_ajp and mod_proxy_balancer comes as part of standard Apache 2.2+ distribution
Ability to use http https or AJP protocols, even within the same balancer.
Cons:
mod_proxy_ajp does not support large 8K+ packet sizes.
Basic load balancer
Does not support Domain model clustering
mod_jk
Pros:
Advanced load balancer
Advanced node failure detection
Support for large AJP packet sizes
Cons:
Need to build and maintain a separate module
Conclusion
My personal suggestion is to use the mod_jk if you can, and if you have the staff to maintain the module binary versions. Mod_proxy is still in active development and misses some of the features from mod_jk. However if there is a need to use the https or a simple load balancing scenario use the mod_proxy.
发表评论
-
sysctl.conf
2011-07-06 14:54 1764fs.file-max=51200 net.core.net ... -
top的替代工具
2011-06-28 15:06 1475dstat -cgilpymn collectl and ... -
有用的小工具
2010-12-23 11:51 1356pv stream nessus Nikto ski ... -
调优linux i/o 行为
2010-11-25 11:27 2926http://www.westnet.com/~gsmith/ ... -
服务器部署工具
2010-11-12 16:32 2068http://www.linuxlinks.com/artic ... -
开源的配置管理工具
2010-11-12 16:24 1476最佳开源配置管理工具: Puppet / 提名:OpenQ ... -
优化ext3的mount选项
2010-11-12 10:24 1360defaults,commit=600,noatime,nod ... -
恢复r710biso 出厂设置
2010-11-10 10:30 1225ALT+E/F/B -
每进程io监控工具
2010-11-02 14:14 1664iodump iotop iopp pidstat b ... -
Intel Xeon 5500/5600系列 CPU服务器内存设置
2010-11-01 21:29 4857http://www.xasun.com/article/2a ... -
zabbix短信报警脚本文件
2010-10-21 14:28 2794附件 -
天外飞仙级别的Linux Shell命令
2010-10-16 09:59 1471本文编译自commandlinefu.com ( 应该是 Ca ... -
lenny+r710+lvm 重启问题解决方案
2010-10-15 14:22 1135ro rootdelay=10 quiet -
fai,debian 自动安装工具
2010-10-15 13:36 1123http://sys.firnow.com/linux/x80 ... -
十个服务器监控工具
2010-09-26 11:44 1841一位国外的技术博主在 ... -
restrict authorized_keys
2010-09-06 09:45 1269command="/home/someuser/rs ... -
sysctl优化设置
2010-09-05 11:25 1170sysctl 是一个用来在系统运作中查看及调整系统参数的工 ... -
proc文件系统
2010-09-05 11:22 1281什么是proc文件系统? proc文件系统是一个伪 ... -
nfs使用
2010-09-02 17:01 1160http://www.linuxhomenetworking. ... -
lsof example
2010-08-23 12:40 12781、查看文件系统阻塞 ...
相关推荐
Practical Mod Perl <br> Copyright Preface What You Need to Know Who This Book Is For How This Book Is Organized Reference Sections Filesystem Conventions Apache ...
在`Comparing Java objects with equals and hashcode.pdf`文档中,可能会详细讨论这些方法的实现细节、最佳实践和潜在陷阱,例如: - 如果重写了`equals()`,也应该重写`hashCode()`,以遵循合同约定。 - 当`...
随着现代科技的飞速发展,电机在工业、运输以及日常生活中扮演着至关重要的角色。特别是磁滞电机,因其特有的工作原理及性能优势,在精确速度控制领域中占据了一席之地。磁滞电机的性能,特别是输出转矩、电流消耗和...
Application Centric Infrastructure ACI LiveLessons
matlab提取股票数据代码Comparing_humans_vs_DPGMM_zh_CN 模型 我准备了训练dpgmm模型的功能: 1如果只希望使用mfcc,则可以使用脚本'script_create_feature_file'(具有name_of_features_wanted = mfccs)从.wav...
标题 "JDBC_sorting_Comparing_" 暗示了这个主题是关于在Java环境中使用JDBC(Java Database Connectivity)进行数据排序,并且涉及到对象的`equals`和`hashCode`方法的重写。`equals`和`hashCode`方法是Java中的...
CAN FD 传统CAN之比较 CAN-FD比CAN总线的带宽更高,具有与CAN总线相似的控制器接口,这种相似性使ECU供应商不需要对ECU的软件部分做大规模修改,降低了开发难度和成本。CAN-FD是CAN总线的升级换代设计,它继承了CAN...
“Analyzing and Comparing Montgomery Multiplication Algorithms”(分析与比较蒙哥马利模乘算法)这篇文章旨在深入探讨并对比不同的蒙哥马利模乘算法实现方法。蒙哥马利模乘算法是一种在计算机科学中广泛应用的...
互信息计算matlab代码关于跨生物标志物异质性的比较 概述 这是对MATLAB代码和数据的描述,并附有Steininger等人的论文“关于比较跨生物标志物的异质性”,该论文将在Cytometry A上发表。 这项工作的主要贡献是一种...
"comparing_geometric_paths"这个项目专注于研究如何有效地衡量两条路径之间的相似度,特别是在使用离散Frechet距离这一概念时。离散Frechet距离是评估两个曲线之间最短的连续路径长度,使得一条路径上的点可以沿着...
'comparing_voting_systems.m' 给出了如何使用 'voting_simulations.m' 函数文件的示例。 投票系统 先发制人 First-past-the-post (FPTP) 是北美最广为人知的系统。 在这个系统中,每个人都可以为自己喜欢的候选人投...
文章“Comparing the Struts 1 and Struts 2 Web Application Frameworks”可能详细分析了这两个框架的各个方面,包括但不限于配置方式、开发效率、错误处理、性能测试等。通过阅读文档,开发者可以获取更多实用的...
在内容部分中,提到的文章“Characterizing and Comparing Phylogenies from their Laplacian Spectrum”发表在系统生物学杂志(Systematic Biology)上,卷号为65,期号为3,页码范围495-507。文章是通过拉普拉斯谱...
2002年发表的论文《Comparing Linear Discriminant Analysis and Support Vector Machine》对比了这两种算法在分类任务中的表现和特点。由于文档内容是由OCR扫描技术处理,可能包含文字识别错误或遗漏。不过,我们仍...
Comparing Realism and Idealism as Classic Schools of Thought
本文《Attention Flows:Analyzing and Comparing Attention Mechanisms in Language Models》是一篇研究论文,主要关注于深度学习领域内语言模型的注意力机制。随着自然语言处理(NLP)技术的发展,基于注意力机制...
ORB(Oriented FAST and Rotated BRIEF)和AKAZE(Accelerated-KAZE)是两种用于此目的的算法,它们分别代表了不同的技术路线。 ORB算法基于FAST关键点检测器和BRIEF描述子,它们都经过了优化以提高速度和旋转不变...
7. "comparing me _______my brother",选A "with",比较...和... 8. "He was _______to see an old friend of_______",选D "surprised, his",be surprised to do sth. 表示对做某事感到惊讶,of后接名词性物主...
### 设计模式在Java与AspectJ中的对比分析 #### 背景介绍 设计模式作为软件工程领域的重要组成部分,旨在解决软件开发过程中遇到的常见问题。随着面向对象编程的普及,设计模式得到了广泛的应用和发展。...