session replication 和session sticky

是多台J2EE服务器集群时的会话策略问题。
因为session是存在服务器端的,多台服务器集群时,
session replication 策略是复制会话,即一个用户访问了一次就把session复制到所有的服务器或这一部分服务器。这样的好处是如果正访问的服务器down了
用户可以自动被转到别的服务器session不丢失。缺点当然是效率低。

session sticky策略则是不复制,一个用户访问了一次后,同一个session周期内,所有的请求都定向到这个服务器,down了session就丢了。

Sticky session refers to the feature of many commercial load balancing solutions for web-farms to route the requests for a particular session to the same physical machine that serviced the first request for that session. This is mainly used to ensure that a in-proc session is not lost as a result of requests for a session being routed to different servers. Since requests for a user are always routed to the same machine that first served the request for that session, sticky sessions can cause uneven load distribution across servers.

你可能感兴趣的:(session replication 和session sticky)