

# REL01-BP06 確保目前配額與最大用量之間存在足夠差距以適應容錯移轉
<a name="rel_manage_service_limits_suff_buffer_limits"></a>

本文說明如何維護資源配額與用量之間的空間，以及如何讓您的組織受益。在完成使用資源之後，用量配額可能會繼續佔用該資源。這可能會導致資源失敗或無法存取。透過確認您的配額是否涵蓋無法存取資源及其替換項目的重疊，來防止資源失敗。計算此差距時，應考慮諸如網路失敗、可用區域失敗或區域失敗等案例。

 **預期成果：**資源或資源可存取性中的小型或大型故障可涵蓋在目前的服務閾值內。已在資源規劃中考慮區域 (Zone) 失敗、網路失敗或甚至是區域 (Regional) 失敗。

 **常見的反模式：**
+  根據目前的需求設定服務配額，而不考慮容錯移轉案例。
+  計算服務的尖峰配額時，未考慮靜態穩定性的主體。
+  計算每個區域所需的配額總計時，未考慮可能有無法存取的資源。
+  未針對某些服務及其潛在異常用量模式考慮 AWS 服務故障隔離界限。

 **建立此最佳實務的優勢：**當服務中斷事件影響應用程式可用性時，請使用雲端來實作策略，以便從這些事件中復原。一個範例策略是建立額外的資源來取代無法存取的資源，以適應容錯移轉條件，而不會耗盡您的服務限制。

 **未建立此最佳實務時的曝險等級：**中 

## 實作指引
<a name="implementation-guidance"></a>

 評估配額限制時，請考慮由於某些降級而可能發生的容錯移轉案例。請考慮下列容錯移轉情況。
+  中斷或無法存取的 VPC。
+  無法存取的子網路。
+  影響資源可存取性的降級可用區域。
+  聯網路由或輸入和輸出點遭到封鎖或變更。
+  影響資源可存取性的降級區域。
+  受區域或可用區域中的失敗所影響的資源子集。

 容錯移轉的決策對於每個情況都是獨一無二的，因為業務影響有所不同。在決定容錯移轉應用程式或服務之前，先處理容錯移轉位置中的資源容量規劃和資源的配額。

 審核每個服務的配額時，請考慮高於正常的活動峰值。這些峰值可能與由於聯網或權限而無法存取但仍處於活動狀態的的資源相關。未終止的作用中資源會計入服務配額限制。

 **實作步驟** 
+  維持服務配額和最大用量之間的空間，以適應容錯移轉或可存取性的喪失。
+  確定服務配額。說明典型的部署模式、可用性需求和使用量增長。
+  視需要請求增加配額。預計配額增加請求的等待時間。
+  確定您的可靠性需求 (也稱為「幾個 9」)。
+  了解可能的故障案例，例如元件遺失、可用區域或區域。
+  建立您的部署方法 (範例包括 Canary、藍/綠、紅/黑或滾動)。
+  為當前配額限制新增適當的緩衝。範例緩衝為 15%。
+  適當時包含靜態穩定性的計算 (區域 (Zonal) 和區域 (Regional))。
+  規劃使用量增長並監控使用量趨勢。
+  考慮最關鍵工作負載的靜態穩定性影響。評估符合所有區域和可用區域中靜態穩定系統的資源。
+  考慮使用隨需容量保留，在任何容錯移轉之前排程容量。這是針對關鍵業務排程而實作的有用策略，可以降低在容錯移轉期間取得正確數量和資源類型的潛在風險。

## 資源
<a name="resources"></a>

 **相關的最佳實務：**
+  [REL01-BP01 了解服務配額和限制](rel_manage_service_limits_aware_quotas_and_constraints.md) 
+  [REL01-BP02 管理跨帳戶和區域的服務配額](rel_manage_service_limits_limits_considered.md) 
+  [REL01-BP03 透過架構適應固定服務配額和限制](rel_manage_service_limits_aware_fixed_limits.md) 
+  [REL01-BP04 監控和管理配額](rel_manage_service_limits_monitor_manage_limits.md) 
+  [REL01-BP05 自動化配額管理](rel_manage_service_limits_automated_monitor_limits.md) 
+  [REL03-BP01 選擇如何分割工作負載](rel_service_architecture_monolith_soa_microservice.md) 
+  [REL10-BP01 將工作負載部署至多個位置](rel_fault_isolation_multiaz_region_system.md) 
+  [REL11-BP01 監控工作負載的所有元件以偵測故障](rel_withstand_component_failures_monitoring_health.md) 
+  [REL11-BP03 將所有分層的修復自動化](rel_withstand_component_failures_auto_healing_system.md) 
+  [REL12-BP04 使用混沌工程測試彈性](rel_testing_resiliency_failure_injection_resiliency.md) 

 **相關文件：**
+ [AWS Well-Architected Framework 的可靠性支柱：可用性](https://docs.aws.amazon.com/wellarchitected/latest/reliability-pillar/availability.html)
+  [AWS Service Quotas (先前稱為 Service Limits)](https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html) 
+  [AWS Trusted Advisor 最佳實務檢查 (請參閱 Service Limits 章節)](https://aws.amazon.com/premiumsupport/technology/trusted-advisor/best-practice-checklist/) 
+  [AWS Answers 上的 AWS Limit Monitor](https://aws.amazon.com/answers/account-management/limit-monitor/) 
+  [Amazon EC2 Service Limits](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-resource-limits.html) 
+  [什麼是 Service Quotas？](https://docs.aws.amazon.com/servicequotas/latest/userguide/intro.html) 
+ [如何請求提高配額](https://docs.aws.amazon.com/servicequotas/latest/userguide/request-quota-increase.html)
+ [服務端點和配額](https://docs.aws.amazon.com/general/latest/gr/aws-service-information.html)
+  [Service Quotas 使用者指南](https://docs.aws.amazon.com/servicequotas/latest/userguide/intro.html) 
+ [Quota Monitor for AWS](https://aws.amazon.com/solutions/implementations/quota-monitor/)
+ [AWS 故障隔離界限](https://docs.aws.amazon.com/whitepapers/latest/aws-fault-isolation-boundaries/abstract-and-introduction.html)
+ [備援的可用性](https://docs.aws.amazon.com/whitepapers/latest/availability-and-beyond-improving-resilience/availability-with-redundancy.html)
+ [AWS for Data](https://aws.amazon.com/data/)
+ [什麼是持續整合？](https://aws.amazon.com/devops/continuous-integration/)
+ [什麼是持續交付？](https://aws.amazon.com/devops/continuous-delivery/)
+ [APN 合作夥伴：可以幫助進行組態管理的合作夥伴](https://partners.amazonaws.com/search/partners?keyword=Configuration+Management&ref=wellarchitected)
+ [管理 AWS 上每租用戶帳戶 SaaS 環境中的帳戶生命週期](https://aws.amazon.com/blogs/mt/managing-the-account-lifecycle-in-account-per-tenant-saas-environments-on-aws/)
+ [管理和監控工作負載中的 API 限流](https://aws.amazon.com/blogs/mt/managing-monitoring-api-throttling-in-workloads/)
+ [使用 AWS Organizations 大規模檢視 AWS Trusted Advisor 建議](https://aws.amazon.com/blogs/mt/organizational-view-for-trusted-advisor/)
+ [使用 AWS Control Tower 自動提高服務限制和企業支援](https://aws.amazon.com/blogs/mt/automating-service-limit-increases-enterprise-support-aws-control-tower/)
+ [Service Quotas 的動作、資源和條件金鑰](https://docs.aws.amazon.com/service-authorization/latest/reference/list_servicequotas.html)

 **相關影片：**
+  [AWS Live re:Inforce 2019 - Service Quotas](https://youtu.be/O9R5dWgtrVo) 
+ [使用 Service Quotas 檢視和管理 AWS 服務的配額](https://www.youtube.com/watch?v=ZTwfIIf35Wc)
+ [AWS IAM 配額示範](https://www.youtube.com/watch?v=srJ4jr6M9YQ)
+ [AWS re:Invent 2018：閉環與開放思維：如何取得大小型系統的控制權](https://www.youtube.com/watch?v=O8xLxNje30M)

 **相關工具：**
+ [AWS CodeDeploy](https://aws.amazon.com/codedeploy/)
+ [AWS CloudTrail](https://aws.amazon.com/cloudtrail/)
+ [Amazon CloudWatch](https://aws.amazon.com/cloudwatch/)
+ [Amazon EventBridge](https://aws.amazon.com/eventbridge/)
+ [Amazon DevOps Guru](https://aws.amazon.com/devops-guru/)
+ [AWS Config](https://aws.amazon.com/config/)
+ [AWS Trusted Advisor](https://aws.amazon.com/premiumsupport/technology/trusted-advisor/)
+ [AWS CDK](https://aws.amazon.com/cdk/)
+ [AWS Systems Manager](https://aws.amazon.com/systems-manager/)
+ [AWS Marketplace](https://aws.amazon.com/marketplace/search/results?searchTerms=CMDB)