www.awsgood.com
建立 ELB 要注意的功能
官方文件 開始的描述如下:
By default, your load balancer distributes incoming requests evenly across its enabled Availability Zones. To ensure that your load balancer distributes incoming requests evenly across all back-end instances, regardless of the Availability Zone that they are in, enable cross-zone load balancing.
我翻譯成這樣:
LB 預設值會平均的、且跨越 AZ 來處理 Request。如果打算確保 LB 平均的分散 Request 到所有的 Backend instances,不管那些 instances 是在哪一個 AZ,那麼打開 *Cross-zone Load Balancing*
邏輯上理解 Cross-Zone Enabled/Disabled 的差異:
Best Practice and 官方建議:
另外,ELB 的 CloudWatch – Health count,如果 Cross-Zone 是 Disabled,health count 數值只有實際的一半,Enabled 才是 Instance Count。
官方文件 (Elastic Load Balancing Metrics) 說明如下:
|
1
|
The number of healthy instances in each Availability Zone. An instance is considered healthy if it meets the healthy threshold configured for the health checks. If cross-zone load balancing is enabled, the number of healthy instances is calculated across all Availability Zones.
|
大概意思:每個 AZ 的 healthy instances 數。如果 cross-zone enabled,就會計算所有 AZ 裡的 instance 數
Drain 翻譯是 “排水” 的意思。如果 ELB 開啟 Connection Draining,那麼以下狀況就會停止送 Request 到 instance:
使用情境:
不行,但可以透過 Route53 Routing Policy 指定不同的 region 的 ELB, policy 有 Geolocation, Weight, Latency, … 等方式。
同一個 Session 固定使用同一個 instance。通常是 stateful 的設計,或者後端資源無法 share 的狀況。
以下是整理自 FAQ.
補充一點,如果有瞬間大量的需求,而且時間是可以預期的,那麼可以開 AWS Support ,請 ELB Team 幫忙 Pre-warming ELB. 最好一週前準備。
Reference