diff --git a/docs/operations/capacity-management/match-utilization-requirements-of-vm.md b/archive/operations/capacity-management/match-utilization-requirements-of-vm.md similarity index 100% rename from docs/operations/capacity-management/match-utilization-requirements-of-vm.md rename to archive/operations/capacity-management/match-utilization-requirements-of-vm.md diff --git a/docs/operations/capacity-management/match-utilization-requirements-with-pre-configured-server.md b/archive/operations/capacity-management/match-utilization-requirements-with-pre-configured-server.md similarity index 100% rename from docs/operations/capacity-management/match-utilization-requirements-with-pre-configured-server.md rename to archive/operations/capacity-management/match-utilization-requirements-with-pre-configured-server.md diff --git a/docs/operations/capacity-management/rightsize-compute-to-match-utilization.md b/docs/operations/capacity-management/rightsize-compute-to-match-utilization.md new file mode 100644 index 000000000..7f5638368 --- /dev/null +++ b/docs/operations/capacity-management/rightsize-compute-to-match-utilization.md @@ -0,0 +1,67 @@ +--- +version: 1.0 +submitted_by: dubrie +published_date: 2022-11-10 +category: Operations +description: Compute capacity that is provisioned well above what a workload actually uses wastes energy and embodied carbon. Rightsizing matches allocated compute to measured utilization, either by resizing a VM's resources or by moving to a better-fitting pre-configured instance type. +tags: + - compute + - monitoring + - size:small + - persona:infrastructure-engineer + - persona:devops-engineer +personas: Infrastructure Engineer, DevOps Engineer +--- + +# Rightsize compute to match utilization + +## Description + +Compute is routinely provisioned for a worst case that rarely happens. A VM or server running at low utilization still draws a large share of its peak power, so energy use is not proportional to the work done. Two lightly loaded servers consume more energy than one running at a higher utilization, and each additional server carries its own embodied carbon. The unused capacity on an underutilized machine could be used for other work instead of provisioning more hardware. + +Oversizing is usually a default rather than a decision: capacity is chosen at launch, never revisited, and carried forward as workloads change. + +## Solution + +Measure actual utilization (CPU, memory, and where relevant network and disk) over a period long enough to include normal peaks, then match allocated compute to what the workload needs. Two techniques achieve this: + +- **Resize the VM.** Change the resources allocated to an existing VM to fit its measured demand, for example removing memory the workload never touches, or adding a vCPU where it is consistently saturated. +- **Select a better-fitting pre-configured instance type.** Where resources are only available in fixed sizes, move the workload to the instance type (SKU) whose CPU, memory and ratio most closely match the measured requirement, rather than the nearest size up. + +Repeat the review on a regular cadence and after significant changes in workload, as a one-off exercise decays as demand shifts. Where load is spiky, combine rightsizing with scaling that adds and removes instances with demand, so that the baseline is sized for typical load rather than peak. + +## SCI Impact + +`SCI = (E * I) + M per R` +[Software Carbon Intensity Spec](https://grnsft.org/sci) + +- `E`: Decreases. Rightsizing raises the utilization of the remaining capacity, and the more a server is utilized, the more efficiently it turns energy into useful work. Removing idle resources also removes their baseline power draw. +- `M`: Decreases. Fewer or smaller servers are needed to run the same workload, so less embodied carbon is attributed to it. The effect is largest in shared infrastructure where freed capacity avoids new hardware purchases. + +## Cost Impact + +- **Compute costs decrease.** Smaller or better-matched instances are billed at a lower rate. Savings scale with how far the current allocation exceeds measured demand. +- **Committed-spend discounts may limit savings.** Reserved instances or savings plans tied to a specific instance family or size can offset or delay savings until the commitment is renewed or exchanged. +- **Monitoring and review effort adds a small cost.** Collecting utilization data and running regular reviews takes engineering time, though most cloud providers offer rightsizing recommendations at no additional charge. +- **Under-sizing can increase cost.** Degraded performance or incidents caused by too little headroom can cost more than the capacity saved. + +## Assumptions + +- Utilization metrics are available for the workload and cover at least one full business cycle, including known peaks. +- The workload's resource needs are stable enough that a sized allocation remains valid between reviews, or scaling is in place to absorb variation. +- Resources can be resized or the workload migrated to a different instance type without breaching availability requirements. +- Any burst of peak load can be absorbed by scaling out, or by headroom that is deliberately kept and documented. + +## Considerations + +- **Peaks versus averages.** Sizing to average utilization removes the margin needed for bursts. If the workload has occasional peaks and no scaling architecture, retain explicit headroom or add scaling rather than sizing tightly. +- **Resizing can cause disruption.** Some platforms need a restart to change VM size. Schedule changes in maintenance windows and test on non-production first. +- **Fixed instance shapes limit fit.** Pre-configured types may not match the ratio of CPU to memory you need, so the closest SKU may still leave one resource underused. Compare several families before choosing. +- **Memory and I/O are easy to miss.** CPU alone is a poor guide; sizing on CPU can under-provision memory-bound or I/O-bound workloads. +- **Not every workload is a candidate.** Latency-critical or licence-bound workloads may have sizing constraints that outweigh the benefit. + +## References + +- [Hardware Efficiency Principle](https://learn.greensoftware.foundation/practitioner/hardware-efficiency) +- [Energy Efficiency Principle](https://learn.greensoftware.foundation/practitioner/energy-efficiency) +- Related patterns: [Optimize average CPU utilization](/operations/capacity-management/optimize-avg-cpu-utilization), [Scale infrastructure with user load](/operations/capacity-management/scale-infrastructure-with-user-load) diff --git a/docusaurus.config.js b/docusaurus.config.js index 2604d7306..8154fa8b7 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -249,8 +249,10 @@ const config = { { from: "/catalog/cloud/use-async-instead-of-sync", to: "/development/use-async-instead-of-sync" }, // Cloud → Operations: Capacity Management - { from: "/catalog/cloud/match-utilization-requirements-of-vm", to: "/operations/capacity-management/match-utilization-requirements-of-vm" }, - { from: "/catalog/cloud/match-utilization-requirements-with-pre-configured-server", to: "/operations/capacity-management/match-utilization-requirements-with-pre-configured-server" }, + { from: "/catalog/cloud/match-utilization-requirements-of-vm", to: "/operations/capacity-management/rightsize-compute-to-match-utilization" }, + { from: "/catalog/cloud/match-utilization-requirements-with-pre-configured-server", to: "/operations/capacity-management/rightsize-compute-to-match-utilization" }, + { from: "/operations/capacity-management/match-utilization-requirements-of-vm", to: "/operations/capacity-management/rightsize-compute-to-match-utilization" }, + { from: "/operations/capacity-management/match-utilization-requirements-with-pre-configured-server", to: "/operations/capacity-management/rightsize-compute-to-match-utilization" }, { from: "/catalog/cloud/optimize-avg-cpu-utilization", to: "/operations/capacity-management/optimize-avg-cpu-utilization" }, { from: "/catalog/cloud/optimize-peak-cpu-utilization", to: "/operations/capacity-management/optimize-peak-cpu-utilization" }, { from: "/catalog/cloud/scale-down-kubernetes-workloads", to: "/operations/capacity-management/scale-down-kubernetes-workloads" }, diff --git a/src/data/personas.ts b/src/data/personas.ts index 9237468c2..2ca69bc37 100644 --- a/src/data/personas.ts +++ b/src/data/personas.ts @@ -70,8 +70,7 @@ export const personas: Persona[] = [ { title: "Minimize the total number of deployed environments", permalink: "/development/minimizing-deployed-environments", description: "In a given application, there may be a need to utilize multiple environments in the application workflow. Typically, a development environment is used for regular updates, while staging or testing enviroments are used to make sure there are no issues before code reaches a production environment where users may have access. Each added environment has an increasing energy impact, which in turn creates more emissions. As such, it is important to understand the necessity of each enviroment and it's environmental impact.", category: "Development", tags: ["cloud","deployment"] }, { title: "Terminate TLS at border gateway", permalink: "/development/evaluate-whether-to-use-TLS-termination", description: "Transport Layer Security (TLS) ensures that all data passed between the web server and web browsers remain private and encrypted. However, terminating and re-establishing TLS increases CPU usage and might be unnecessary in certain architectures.", category: "Development", tags: ["cloud","security","compute","kubernetes","role:software-engineer","size:medium"] }, { title: "Delete unused storage resources", permalink: "/operations/resource-lifecycle/delete-unused-storage-resources", description: "From an embodied carbon perspective, it's better to delete unused storage resources so we are efficient with hardware and so that the storage layer is optimised for the task.", category: "Operations", tags: ["storage","size:small"] }, - { title: "Match utilization requirements of virtual machines (VMs)", permalink: "/operations/capacity-management/match-utilization-requirements-of-vm", description: "It's better to have one VM running at a higher utilization than two running at low utilization rates, not only in terms of energy proportionality but also in terms of embodied carbon. Two servers running at low utilization rates will consume more energy than one running at a high utilization rate. In addition, the unused capacity on the underutilized server could be more efficiently used for another task or process.", category: "Operations", tags: ["compute","size:small"] }, - { title: "Match utilization requirements with pre-configured servers", permalink: "/operations/capacity-management/match-utilization-requirements-with-pre-configured-server", description: "It's better to have one VM running at a higher utilization than two running at low utilization rates, not only in terms of energy proportionality but also in terms of embodied carbon. Two servers running at low utilization rates will consume more energy than one running at a high utilization rate. In addition, the unused capacity on the underutilized server could be more efficiently used for another task or process.", category: "Operations", tags: ["compute","size:small"] }, + { title: "Rightsize compute to match utilization", permalink: "/operations/capacity-management/rightsize-compute-to-match-utilization", description: "Compute capacity that is provisioned well above what a workload actually uses wastes energy and embodied carbon. Rightsizing matches allocated compute to measured utilization, either by resizing a VM's resources or by moving to a better-fitting pre-configured instance type.", category: "Operations", tags: ["compute","monitoring","size:small"] }, { title: "Optimise storage utilization", permalink: "/operations/resource-lifecycle/optimise-storage-resource-utilisation", description: "It's better to maximise storage utilisation so the storage layer is optimised for the task, not only in terms of energy proportionality but also in terms of embodied carbon. Two storage units running at low utilization rates will consume more energy than one running at a high utilization rate. In addition, the unused capacity on the underutilised storage unit could be more efficiently used for another task or process.", category: "Operations", tags: ["storage","size:small"] }, { title: "Optimize average CPU utilization", permalink: "/operations/capacity-management/optimize-avg-cpu-utilization", description: "CPU usage and utilization varies throughout the day, sometimes wildly for different computational requirements. The larger the variance between the average and peak CPU utilization values, the more resources need to be provisioned in stand-by mode to absorb those spikes in traffic.", category: "Operations", tags: ["compute","monitoring","size:medium"] }, { title: "Optimize peak CPU utilization", permalink: "/operations/capacity-management/optimize-peak-cpu-utilization", description: "CPU usage and utilization varies throughout the day, sometimes wildly for different computational requirements. The larger the variance between the average and peak CPU utilization values, the more resources need to be provisioned in stand-by mode to absorb those spikes in traffic.", category: "Operations", tags: ["compute","monitoring","size:medium"] }, @@ -123,8 +122,7 @@ export const personas: Persona[] = [ { title: "Use serverless cloud services", permalink: "/architecture/technology-selection/use-serverless", description: "Serverless cloud services scale dynamically with demand and share infrastructure across many applications, reducing idle resource consumption and lowering embodied carbon emissions.", category: "Architecture", tags: ["cloud","size:small","serverless"] }, { title: "Minimize the total number of deployed environments", permalink: "/development/minimizing-deployed-environments", description: "In a given application, there may be a need to utilize multiple environments in the application workflow. Typically, a development environment is used for regular updates, while staging or testing enviroments are used to make sure there are no issues before code reaches a production environment where users may have access. Each added environment has an increasing energy impact, which in turn creates more emissions. As such, it is important to understand the necessity of each enviroment and it's environmental impact.", category: "Development", tags: ["cloud","deployment"] }, { title: "Use sustainable regions for AI/ML training", permalink: "/development/leverage-sustainable-regions", description: "Depending on the model parameters and training iterations, training an AI/ML model consumes a lot of power and requires many servers which contribute to embodied emissions.", category: "Development", tags: ["ai","machine-learning","size:small"] }, - { title: "Match utilization requirements of virtual machines (VMs)", permalink: "/operations/capacity-management/match-utilization-requirements-of-vm", description: "It's better to have one VM running at a higher utilization than two running at low utilization rates, not only in terms of energy proportionality but also in terms of embodied carbon. Two servers running at low utilization rates will consume more energy than one running at a high utilization rate. In addition, the unused capacity on the underutilized server could be more efficiently used for another task or process.", category: "Operations", tags: ["compute","size:small"] }, - { title: "Match utilization requirements with pre-configured servers", permalink: "/operations/capacity-management/match-utilization-requirements-with-pre-configured-server", description: "It's better to have one VM running at a higher utilization than two running at low utilization rates, not only in terms of energy proportionality but also in terms of embodied carbon. Two servers running at low utilization rates will consume more energy than one running at a high utilization rate. In addition, the unused capacity on the underutilized server could be more efficiently used for another task or process.", category: "Operations", tags: ["compute","size:small"] }, + { title: "Rightsize compute to match utilization", permalink: "/operations/capacity-management/rightsize-compute-to-match-utilization", description: "Compute capacity that is provisioned well above what a workload actually uses wastes energy and embodied carbon. Rightsizing matches allocated compute to measured utilization, either by resizing a VM's resources or by moving to a better-fitting pre-configured instance type.", category: "Operations", tags: ["compute","monitoring","size:small"] }, { title: "Optimize average CPU utilization", permalink: "/operations/capacity-management/optimize-avg-cpu-utilization", description: "CPU usage and utilization varies throughout the day, sometimes wildly for different computational requirements. The larger the variance between the average and peak CPU utilization values, the more resources need to be provisioned in stand-by mode to absorb those spikes in traffic.", category: "Operations", tags: ["compute","monitoring","size:medium"] }, { title: "Scale down applications when not in use", permalink: "/operations/capacity-management/scale-down-unused-applications", description: "Applications consume CPU even when they are not actively in use. For example, background timers, garbage collection, health checks, etc. Even when the application is shut down, the underlying hardware is consuming idle power.", category: "Operations", tags: ["cloud","size:small"] }, { title: "Scale down kubernetes applications when not in use", permalink: "/operations/capacity-management/scale-down-kubernetes-workloads", description: "In order to reduce carbon emissions and costs, Dev&Test Kubernetes clusters can turn off nodes out of office hours. Thereby, optimization is implemented at the cluster level. For production clusters, where nodes need to stay up and running, optimization needs to be implemented at the application level.", category: "Operations", tags: ["kubernetes","size:small"] },