-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
7 changed files
with
273 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
docs/catalog/cloud/optimize-impact-on-customer-equipment.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
--- | ||
version: 1.0 | ||
submitted_by: markus-ntt-seidl | ||
published_date: TBD | ||
category: cloud | ||
tags: | ||
- cloud | ||
- role:cloud-engineer | ||
- size:small | ||
--- | ||
|
||
# Optimize impact on customer devices and equipment | ||
|
||
## Description | ||
|
||
Applications run on customer hardware or are displayed on it. The hardware used by the customer has a carbon footprint embodied through the production and electricity required while running. Optimising your software design and architecture to extend the life of the customer devices reduces the carbon intensity of the application. | ||
Ideally the customer can use the hardware until it's failure or until it becomes obsolete. | ||
|
||
|
||
## Solution | ||
|
||
Understand the devices and equipment your customers use to consume your services. Implement software patterns and architectures to minimize the need for customers to replace devices and upgrade equipment. | ||
A few examples on how this could be achieved: | ||
* Implement new features using code that is backwards compatible with older hardware and operating system versions or disable them on older hardware only so the application can still be used | ||
* Support older browser versions and optimize the UX for an older tier of CPUs | ||
* Optimize network bandwidth for older devices or customers that have limited connectivity | ||
|
||
## SCI Impact | ||
|
||
`SCI = (E * I) + M per R` | ||
[Software Carbon Intensity Spec](https://grnsft.org/sci) | ||
|
||
Concerning the SCI equation, optimize impact on customer devices will impact two parts: | ||
|
||
- `I`: Optimizing for older hardware might reduce the carbon intensity if it also runs more efficiently in general | ||
- `M`: Using older devices allows hardware to be used longer and therefore reduces the embodied carbon impact | ||
|
||
## Assumptions | ||
|
||
- This pattern assumes that the team does have sufficient time and resources to implement backwards compatibility and optimize the application | ||
|
||
## Considerations | ||
|
||
- Consider the other cloud patterns to optimize the application itself inside the cloud environment | ||
|
||
## References | ||
|
||
- [AWS Sustainability Pillar](https://docs.aws.amazon.com/wellarchitected/latest/sustainability-pillar/sus_sus_software_a6.html) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--- | ||
version: 1.0 | ||
submitted_by: markus-ntt-seidl | ||
published_date: TBD | ||
category: cloud | ||
tags: | ||
- cloud | ||
- role:cloud-engineer | ||
- size:small | ||
--- | ||
|
||
# Remove unused assets | ||
|
||
## Description | ||
|
||
Monitor and analyze the application and the cloud bill to identify resources that are no longer used or can be reduced. | ||
|
||
## Solution | ||
|
||
Decommission unused assets to free consumed resources. Consolidate resources, for example different database instances with a only a few tables could be moved into one instance. Review generated assets if they contain redundant content and handle them accordingly. | ||
Inspect storage buckets if unused assets can be removed. | ||
|
||
## SCI Impact | ||
|
||
`SCI = (E * I) + M per R` | ||
[Software Carbon Intensity Spec](https://grnsft.org/sci) | ||
|
||
With respect to the SCI equation, remove unused assets will impact one part: | ||
|
||
- `E`: Reduces the electricity by not using resources | ||
- `M`: Removing unused resources also reduces the embodied emissions, for example by reducing the storage or CPUs needed | ||
|
||
## Assumptions | ||
|
||
- Assumes that resources can be decommissioned | ||
|
||
## Considerations | ||
|
||
- Consider creating monitoring to more easily identify resources that are no longer needed | ||
|
||
## References | ||
|
||
- [AWS Sustainability Pillar](https://docs.aws.amazon.com/wellarchitected/latest/sustainability-pillar/sus_sus_user_a4.html) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- | ||
version: 1.0 | ||
submitted_by: markus-ntt-seidl | ||
published_date: TBD | ||
category: cloud | ||
tags: | ||
- cloud | ||
- role:cloud-engineer | ||
- size:small | ||
- serverless | ||
--- | ||
|
||
# Use serverless cloud services | ||
|
||
## Description | ||
|
||
Serverless cloud services are services that the cloud provider manages for the application. These scale dynamically with the workload needed to fulfill the service task and apply best practices to keep resource usage minimal. | ||
|
||
## Solution | ||
|
||
Evaluate serverless based on your application requirements. | ||
|
||
## SCI Impact | ||
|
||
`SCI = (E * I) + M per R` | ||
[Software Carbon Intensity Spec](https://grnsft.org/sci) | ||
|
||
Regarding the SCI equation. using serverless cloud services will impact: | ||
|
||
- `I`: Resources are only running when in use and shared over many applications, the carbon intensity will decrease. There is a slight increase in provisioning serverless structures (for example AWS Lambda cold starts), overall the carbon intensity still decreases. | ||
- `M`: Serverless architectures share resources and only use resources when needed, this reduces the embodied carbon. | ||
|
||
## Assumptions | ||
|
||
- The cloud provider provides serverless services for the technologies the application uses | ||
- There is an assumption that the application can benefit from serverless architectures | ||
|
||
## Considerations | ||
|
||
- Evaluate and consider what workloads can be moved to serverless. Using serverless patterns can involve a complete redesign of the application architecture. | ||
- Consider if your application can afford a cold start during serverless resource initialization. | ||
|
||
## References | ||
|
||
- [Azure Dev Blog](https://devblogs.microsoft.com/sustainable-software/adopting-azure-serverless-architectures-to-help-reduce-co2-emissions-part-1/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
--- | ||
version: 1.0 | ||
submitted_by: markus-ntt-seidl | ||
published_date: TBD | ||
category: web | ||
tags: | ||
- web | ||
- size:small | ||
- role:web-developer | ||
--- | ||
|
||
# Enable text compression | ||
|
||
## Description | ||
|
||
Web browsers often communicate with web servers in a human readable format. These can be HTML, JavaScript and/or CSS - files and also REST requests which can return a response in JSON. This communication is human readable and therefore highly redundant, therefore it can be highly compressed saving a lot of bandwidth. | ||
|
||
Web browsers and servers can communicate the compression format dynamically via the "Accept-Encoding"/"Content-Encoding" HTTP Headers. This allows the communication to dynamically switch to compression formats both side support. | ||
|
||
|
||
## Solution | ||
|
||
Enable all supported compression formats on the server, this allows clients to use the best available format. | ||
|
||
|
||
## SCI Impact | ||
|
||
`SCI = (E * I) + M per R` | ||
[Software Carbon Intensity Spec](https://grnsft.org/sci) | ||
|
||
Concerning the SCI equation, the compression will impact the equation as follows: | ||
|
||
- `E`: Reducing the amount of emissions by reducing electricity needed while transferring and processing text files. | ||
- `M`: Reducing the amount of size of the files can also reduce the amount of storage requirements of the web page on the server | ||
|
||
## Assumptions | ||
|
||
- The ability to use web servers that allow compression formats | ||
|
||
## Considerations | ||
|
||
|
||
|
||
## References | ||
- [HTTP compression](https://en.wikipedia.org/wiki/HTTP_compression) | ||
- [Information about Brotli, a common web compression algorithm](https://en.wikipedia.org/wiki/Brotli) | ||
- [Compression Format WebBrowser Implementation Status](https://caniuse.com/?search=content-encoding) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
version: 1.0 | ||
submitted_by: markus-ntt-seidl | ||
published_date: TBD | ||
category: web | ||
tags: | ||
- size:medium | ||
- role:web-developer | ||
- web | ||
--- | ||
|
||
# Keep request counts low | ||
|
||
## Description | ||
|
||
Accessing a web page usually retrieves a HTML file from the web server. The HTML can then reference additional resources that the browser has to download. | ||
To use the least amount of CO2, reduce the amount of files needed to display a page in the browser. | ||
|
||
## Solution | ||
|
||
Reduce the amount of files needed and also the amount of requests done by the loaded JavaScript to display the final page. | ||
|
||
## SCI Impact | ||
|
||
`SCI = (E * I) + M per R` | ||
[Software Carbon Intensity Spec](https://grnsft.org/sci) | ||
|
||
Concerning the SCI equation, keeping the request counts low will impact: | ||
|
||
- `E`: Reducing the amount of requests reduces the energy needed to display the page | ||
- `M`: Reducing the amount of requests can also reduce the amount of files and therefore the storage requirements of the web page on the server | ||
|
||
|
||
## Assumptions | ||
|
||
|
||
## Considerations | ||
|
||
- Consider setting up request count budgets that are measured when the application is tested via test automation | ||
|
||
|
||
## References | ||
|
||
- [Detailed description](https://web.dev/resource-summary/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
version: 1.0 | ||
submitted_by: markus-ntt-seidl | ||
published_date: TBD | ||
category: web | ||
tags: | ||
- web | ||
- compute | ||
- role:web-developer | ||
- size:small | ||
--- | ||
|
||
# Minimize main thread work | ||
|
||
## Description | ||
|
||
Web browsers traditionally consist of a main rendering thread that handles most of the updates on the web page and the execution of JavaScript. JavaScript is executed on the main thread to simplify JavaScript implementations so the JavaScript programmer doesn't have to deal with any multi-threading programming patterns. | ||
When doing long running JavaScript computations it is running single threaded. In contrast all CPUs nowadays have multiple cores which have to be powered on while being underutilized. | ||
|
||
## Solution | ||
|
||
For long running JavaScript computations (e.g. computations that run longer than a few 100 ms) try to use WebWorkers and run them in another thread while keeping the main rendering thread free. Consider moving the JavaScript computation to efficient server implementations that use optimized algorithms. | ||
|
||
## SCI Impact | ||
|
||
`SCI = (E * I) + M per R` | ||
[Software Carbon Intensity Spec](https://grnsft.org/sci) | ||
|
||
Concerning the SCI equation, minimize main thread work will impact as follows: | ||
|
||
- `E`: CPU resources can be used more efficiently which reduces the electricity required and reduces the carbon intensity | ||
|
||
## Assumptions | ||
|
||
- An assumption is made that the code in question can be moved of the main rendering thread | ||
|
||
## Considerations | ||
|
||
- Consider moving the workload to a efficient server implementation | ||
|
||
## References | ||
|
||
- [Main thread work breakdown](https://web.dev/mainthread-work-breakdown/) | ||
- [What is a good Total Blocking Time](https://www.debugbear.com/docs/metrics/total-blocking-time#whats-a-good-total-blocking-time) |