zoukankan      html  css  js  c++  java
  • sticky session 粘性会话

     New Elastic Load Balancing Feature: Sticky Sessions | AWS News Blog https://amazonaws-china.com/cn/blogs/aws/new-elastic-load-balancing-feature-sticky-sessions/

    New Elastic Load Balancing Feature: Sticky Sessions

    by Jeff Barr | on 07 APR 2010 | in Amazon EC2LaunchNews | Permalink |  Share

    Amazon EC2’s Elastic Load Balancing feature just became a bit more powerful. Up until now each load balancer had the freedom to forward each incoming HTTP or TCP request to any of the EC2 instances under its purview. This resulted in a reasonably even load on each instance, but it also meant that each instance would have to retrieve, manipulate, and store session data for each request without any possible benefit from locality of reference.

    Suppose two separate web browsers each request three separate web pages in turn. Each request can go to any of the EC2 instances behind the load balancer, like this:

    When a particular request reaches a given EC2 instance, the instance must retrieve information about the user from state data that must be stored globally. There’s no opportunity for the instance to cache any data since the odds that several requests from the same user / browser will go down as more instances are added to the load balancer.

    With the new sticky session feature, it is possible to instruct the load balancer to route repeated requests to the same EC2 instance whenever possible.

    In this case, the instances can cache user data locally for better performance. A series of requests from the user will be routed to the same EC2 instance if possible. If the instance has been terminated or has failed a recent health check, the load balancer will route the request to another instance. Of course, in a real world scenario, there would be more than two users, and the third EC2 instance wouldn’t be sitting idle.

    Full information on this new feature can be found in the Elastic Load Balancer documentation.

    Update: Shlomo Swidler wrote a really nice post on Elastic Load Balancing with Sticky Sessions. I’d encourage you to check it out to learn more about why sticky sessions can improve your application.

    — Jeff;

     
     
     
  • 相关阅读:
    关于sizeof,对空指针sizeof(*p)可以吗?
    Mysql之锁(一)
    Mysql之事务
    Mysql之Explain关键字及常见的优化手段
    Mysql查询优化器之关于子查询的优化
    Mysql查询优化器之关于JOIN的优化
    Mysql查询优化器之基本优化
    Mysql之B+树索引实战
    Mysql之索引
    Mysql之InnoDB行格式、数据页结构
  • 原文地址:https://www.cnblogs.com/rsapaper/p/7840703.html
Copyright © 2011-2022 走看看