当前位置:首页 > 开发 > 编程语言 > Http > 正文

related articles about LVS & Http Session

发表于: 2005-12-26   作者:buaawhl   来源:转载   浏览次数:
摘要: Session in http unde LVS http://lists.community.tummy.com/pipermail/linux-ha-dev/2001-December/002993.html 引用 2. I can set up a separate URL for session based apps that sends all requests to&n
Session in http unde LVS
http://lists.community.tummy.com/pipermail/linux-ha-dev/2001-December/002993.html
引用

2. I can set up a separate URL for session based apps that sends all requests
to  a heatbeat duplicated session manager on the first tier using
Apache/webapps/Tomcat  to load balance to the next tier down. The load
balancing in webapps/mod_jk  assures that the session always returns to the
same machine the the cluster.  This solution increases the complexity of the
cluster and it's management.. If the load grows too much I can always
esatblish another set of session managers. I don't have to go hammer my
developers to comply with yet another set of demands out of systems. It's
hard enough to get compliance on logging and testing....


LVS: Cluster friendly versions of applications that need to maintain state
http://www.austintek.com/LVS/LVS-HOWTO/HOWTO/LVS-HOWTO.cluster_friendly_applications.html
引用

    *

      What are sessions?

      When an application written on top of a stateless protocol like HTTP has a need of stateful transactions, it typically writes some data to disk between requests and retrieves these data again on the subsequent request. This mechanism is known as session handling. The session data typically get written to files or databases. Each followup-request sends some sort of token to the server so that the application can retrieve the correct file or correct record in the database.
    *

      The old-fashined way to identify sessions

      At the time when every webserver was a single PC, the session token identified a filename or a record in a database and everything was OK. When an application that relies on this mechanism is ported to a cluster environment, it stops working unless one deteriorates the cluster with a mechanism called persistence. Persistence is a quick and dirty way to get the old-fashioned token to work. It's not a very clever way though.
    *

      Why persistence is bad

      Persistence counteracts two purposes of a cluster: easy maintainance by taking single machines out at any time and optimized balancing between the members of a cluster. Above that, persistence consumes memory on the load balancers.
    *

      How to do it better

      Recall that there is a token being sent back and forth anyway, that identifies a filename or a database record. Extend this token to unambiguously point to the machine where the session data were created and install a session server on each host that delivers session data within the cluster to any of the peers on request. From that moment you can run your application truely distributed, you can take single machines out for maintainance any time: you turn their weight to 0 and wait for maybe an hour or three, depending on how long you want your sessions to last. You get better balancing, and you save memory on the balancer. Note, that unlike with a dedicated session server, you do not create a single point of failure with this method.


集群的可扩展性及其分布式体系结构之七--网络负载平衡常见问题
http://www-128.ibm.com/developerworks/cn/linux/cluster/cluster_system/balance/part3/
引用

LVS的存储一致性问题:
在一个通过LVS组建的Web集群环境中,所有涉及Session的应用都面临这样的矛盾:由于会话信息存储在服务结点上,因此一旦建立一次会话--例如登录bbs,之后的所有数据传输必须硬性的指向建立会话连接的节点(该Session以文件的形式保留在节点服务进程的路径下)。这样,会在调度算法上破坏原本正常运行的负载平衡。

但是如果把所有的文件读写放在同一个磁盘上或者指向同一个NFS服务器,可以解决文件读写不一致的问题。但又导致新的问题出现:提供I/O服务的节点成为集群的性能瓶颈!
怎么解决这一效率与功能之间的矛盾呢?可能的方式有:
1、 改写Apache服务器,使之适应LVS的分布式环境
2、 降低性能要求,使用NAS或者NFS服务进行磁盘共享
3、 撰写特殊的PHP或者脚本语言代码
4、 采用分布式文件系统

related articles about LVS & Http Session

  • 0

    开心

    开心

  • 0

    板砖

    板砖

  • 0

    感动

    感动

  • 0

    有用

    有用

  • 0

    疑问

    疑问

  • 0

    难过

    难过

  • 0

    无聊

    无聊

  • 0

    震惊

    震惊

编辑推荐
最近,有一种新的网页布局 ——动态流体布局,很让我感到兴趣。它巧妙地重排元素,并填补了网页的所
session在web开发中是一个非常重要的概念,这个概念很抽象,很难定义,也是最让人迷惑的一个名词,
session和cookie是网站浏览中较为常见的两个概念,也是比较难以辨析的两个概念,但它们在浏览需要认
简明 Vim 练级攻略 2011年9月7日 陈皓 发表评论 阅读评论 26,625 次点击 <div style="margin-top
一些文章和各种资源 2011年9月20日 陈皓 下面是近期收录的一些文章和资源,希望对你有用。 系统方面
转自http://lavasoft.blog.51cto.com/62575/275589 session在web开发中是一个非常重要的概念,这个
session在web开发中是一个非常重要的概念,这个概念很抽象,很难定义,也是最让人迷惑的一个名词,
载自:http://lavasoft.blog.51cto.com/62575/275589 session在web开发中是一个非常重要的概念,这
session在web开发中是一个非常重要的概念,这个概念很抽象,很难定义,也是最让人迷惑的一个名词,也
jetty接受到链接请求,首先要解析请求;jetty中定义了一个HttpParser类来解析http。类中的部分定义
版权所有 IT知识库 CopyRight © 2009-2015 IT知识库 IT610.com , All Rights Reserved. 京ICP备09083238号