

# REL01-BP04 監控和管理配額
<a name="rel_manage_service_limits_monitor_manage_limits"></a>

 評估潛在用量並適當地增加配額，以允許使用量按計劃增長。

 **預期成果：**已經部署管理和監控的主動和自動化系統。這些操作解決方案可確保幾乎達到配額用量閾值。這些會由請求配額變更主動矯正。

 **常見的反模式：**
+ 未設定監控來檢查服務配額閾值
+ 未設定監控硬性限制，即使這些值無法變更。
+  假設請求和保護軟性配額變更所需的時間量是立即或短期間。
+  設定了正在接近服務配額的警示，但無如何回應提醒的程序。
+  僅設定 AWS Service Quotas 所支援之服務的警示，而不監控其他服務 AWS 。
+  未考慮多個區域彈性設計的配額管理，例如主動/主動、主動/被動 – 熱、主動/被動 - 冷和主動/被動 - 指示燈方法。
+  未評估區域之間的配額差異。
+  未評估每個區域特定配額增加請求的需求。
+  不利用[範本進行多區域配額管理](https://docs.aws.amazon.com/servicequotas/latest/userguide/organization-templates.html)。

 **建立此最佳實務的優點：**自動追蹤 AWS Service Quotas，並根據這些配額監控用量，可讓您在接近配額限制時查看 。您也可以使用此監控資料來協助限制由於配額耗盡造成的任何降級。

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

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

 針對支援的服務，您可以藉由設定可評估然後傳送提醒或警示的各種不同服務，來監控您的配額。這可協助監控用量並且可以在您接近配額時提醒您。這些警示可以從 AWS Config、Lambda 函數 CloudWatch、Amazon 或 從 叫用 AWS Trusted Advisor。您也可以在 CloudWatch 日誌上使用指標篩選條件來搜尋和擷取日誌中的模式，以判斷用量是否接近配額閾值。

 **實作步驟** 

 針對監控：
+  擷取當前資源消耗 (例如，儲存貯體或執行個體)。使用 服務API操作，例如 Amazon EC2 `DescribeInstances` API來收集目前的資源消耗。
+  使用以下項目，擷取您目前基本且適用於服務的配額：
  +  AWS Service Quotas 
  +  AWS Trusted Advisor 
  +  AWS 文件 
  +  AWS 服務特定頁面 
  +  AWS Command Line Interface (AWS CLI) 
  +  AWS Cloud Development Kit (AWS CDK) 
+  使用 AWS Service Quotas ，這項 AWS 服務可協助您從單一位置管理超過 250 個 AWS 服務的配額。
+  使用 Trusted Advisor 服務限制來監控您目前在各種閾值的服務限制。
+  使用服務配額歷史記錄 （主控台或 AWS CLI） 來檢查區域增加。
+  比較每個區域和每個帳戶中的服務配額變更，視需要建立等值。

 針對管理：
+  自動化：設定 AWS Config 自訂規則以跨區域掃描服務配額，並比較差異。
+  自動化：設定排定的 Lambda 函數來掃描區域之間的服務配額，並且比較是否有差異。
+  手動：透過 AWS CLI、 API或 AWS 主控台掃描服務配額，以跨區域掃描服務配額並比較差異。報告差異。
+  如果區域之間識別出配額的差異，請視需要請求配額變更。
+  檢閱所有請求的結果。

## 資源
<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-BP05 自動化配額管理](rel_manage_service_limits_automated_monitor_limits.md) 
+  [REL01-BP06 確保目前配額與最大用量之間存在足夠差距以適應容錯移轉](rel_manage_service_limits_suff_buffer_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（先前稱為服務限制）](https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html) 
+  [AWS Trusted Advisor 最佳實務檢查 （請參閱服務限制區段）](https://aws.amazon.com/premiumsupport/technology/trusted-advisor/best-practice-checklist/) 
+  [AWS 限制對 AWS 答案的監控](https://aws.amazon.com/answers/account-management/limit-monitor/) 
+  [Amazon EC2 Service 限制](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) 
+ [ 的配額監控 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 適用於資料 ](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)
+ [ 在 上管理 account-per-tenant SaaS 環境中的帳戶生命週期 AWS](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 Trusted Advisor 建議 AWS Organizations](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) 
+ [ 使用 AWS 服務配額檢視和管理Service Quotas ](https://www.youtube.com/watch?v=ZTwfIIf35Wc)
+ [AWS IAM Quotas 示範 ](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 DevOpsGuru ](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)