是多臺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. web