What is GreenFrame and How Does It Work?

GreenFrame is a command-line tool designed to estimate the carbon footprint of web applications at every stage of the development process. By integrating GreenFrame into your Continuous Integration workflow, you can monitor “carbon leaks” and enforce a maximum emissions threshold.

Key Features:

Scientific Basis: GreenFrame's energy consumption model was developed in collaboration with computer scientists at Loria.

Data Collection: During scenario execution, GreenFrame uses Docker stats to collect system metrics (CPU, memory, network, disk I/O, and scenario duration) every second from the browser and containers.

Energy Calculation: These metrics are converted into energy consumption (in Watt-hours) using the GreenFrame Model. The total energy consumption is calculated by summing the energy of all containers over time, considering a theoretical datacenter PUE (Power Usage Effectiveness) set to 1.4 (configurable).

CO2 Conversion: The energy consumption is then converted into CO2 emissions using a configurable “carbon cost of energy” parameter, set to 442g/kWh by default.

Repetition for Accuracy: The scenario is repeated three times to compute the average energy consumption and CO2 emissions, providing a confidence interval with the standard deviation of these values.

For detailed information on the GreenFrame Model, refer to the article on the Marmelab blog: GreenFrame.io: What is the Carbon Footprint of a Web Page?

Factors Influencing the Carbon Footprint

According to our research, the carbon footprint of a web page is influenced by several factors:

Scenario Duration: The length of time the scenario runs.

Page Size: Includes HTML, CSS, JS, images, fonts, etc.

JavaScript Execution: The amount of JavaScript executed in the browser.

Third-Party Tags: Ads, analytics, and other external tags.

Page Complexity: Number of DOM elements, layout changes, etc.

Server Impact: Server containers usually contribute around 5% to the total carbon footprint.

Optimizing the emissions of a web page can be effectively achieved by employing Web Performance Optimization (WPO) techniques.

Example Usage

To estimate the energy consumption and carbon emissions of a visit to a public web page, use the following GreenFrame command:

$ greenframe analyze https://marmelab.com
✅ main scenario completed
The estimated footprint is 0.038 g eq. CO2 ± 1.3% (0.085 Wh).

GreenFrame provides a clear and actionable way to measure and reduce the carbon footprint of web applications, promoting more sustainable development practices.

Links:

GitHub

Website