知识卡片
会话放置影响故障体验
会话只在单节点内存时,负载均衡切换到另一节点便找不到状态。粘性会话保持用户到同一节点,代价是该节点故障后通常仍要重新登录;放浏览器可随请求携带但增大请求,放数据库则增加共享访问与延迟。应按可接受的登录恢复体验选择,不要假设负载均衡自动迁移内存状态。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 高可用与扩展 · 查看原书依据
We can handle this scenario by using sticky sessions, where the load balancer always sends the requests from the same user to the same server. Even with sticky sessions, if the server fails, the session is lost, and users will have to log in again. However, this is a rare occurrence, and many designs accept this approach.
参考来源
- 位置:《Software Architecture and Decision-Making》第09章《高可用与扩展》(来源项目:book-sources;源文件:extracted/Software Architecture and Decision-Making Leveraging Leadership, Technology, and Product Management to Build Great Products… (Srinath Perera)/_epub-src/ch09.xhtml)
- 结论依据:所引连续原文给出本卡机制或取舍;条件与示例结合本节已读上下文解释。
- 原始内容:We can handle this scenario by using sticky sessions, where the load balancer always sends the requests from the same user to the same server. Even with sticky sessions, if the server fails, the session is lost, and users will have to log in again. However, this is a rare occurrence, and many designs accept this approach.