Reducing the Carbon Footprint of Microservice-Based Cloud Applications by Periodically Scaling their Energy Demand
There are in total 8 different experiments that were conducted:
- Selective Optimization
- Carbon-Unaware (static) Baselines
- Simple carbon-aware approach
- Randomized Energy Budget with up to 40% exceeding budget
- Uniform Recycle Budget
- Hourly Recycle Budget
- Weighted Recycle Budget
- Mathematical Optimum Solution (Note this Approach is not part of the Thesis)
- Randomized Energy Budget with random budget between 80% and 120% (Validation Approach)
The results of the experiments can be found in the form of CSV files in the results folder.
The dataViz folder contains the Jupyter Notebook used to create the visualisations of the results.
The images that were created with the notebook can be found in the img folder.
0. General Data Visualisation
- Carbon Intensity Heatmap
- Energy Budget Heatmap
- Mean Hour in Week Carbon Intensity
- Mean Hour in Week Carbon Budget
- Carbon Budget Utilization
- Revenue
- Revenue to energy demand ratio
- Carbon Emissions
- Statistics Calculations
- Statistical Results that are used in "Interpretation of the Results" Section of the Thesis
The data used for the experiments can be found in the data folder.
It consists of the following data sets:
- Carbon Intensity Data from Electricity Maps for Germany
- User-Request Data from Wikimedia
The carbon intensity data is licensed under ODbl.
The wikimedia pageview dataset is licensed under Creative Commons Zero (CC0) public domain dedication as it is part of the Wikimedia: Analytics Datasets, whose license is stated in https://dumps.wikimedia.org/legal.html.
The data for the application architecture of the flight booking use case is stored in a JSON file.
Additionally there is an XML-Parser that can parse BPMN-models in the form of XML files to JSON files.
The BPMN XML file could for example have been derived from a BMPN modeller, such as bpmn.io.
The derived JSON file can then be enriched with the needed parameters for selectibe optimisation algorithm.
In order to run the experiments, the following requirements need to be met:
- Python 3.9.12
- Gurobi Optimizer (for the mathematical optimum solution): a license is needed
- An academic license can be obtained here.
We advise to use a virtual environment, such as Anaconda.
If you do not have Anaconda installed, you can download it here.
With Anaconda and the following commands, it can be ensured that the same environment is used for the experiments:
conda create --name <env-name> python=3.9.12
conda activate <env-name>
conda install gurobi
pip install -r requirements.txtTo leave your conda envrionment again you can use the following command:
conda deactivateThe Gurobi license has to be activated before the experiments can be run.
grbgetkey <license-key>The experiments can be run by executing the following command:
python3 <x-experiment.py>DISCLAIMER: The experiments can take a long time to run, depending on the parameters that are used. or by executing the shell script main.sh in the results folder:
cd experiments
chmod +x main.sh
./main.shThe lib.py file contains all the functions used in multiple experiments. Some of the experiment files itself have single functions that are only used in that specific experiment
In lib.py the following functions can be found:
- The Selectibe Optimization Algorithm
- num_days_between
- weekdayfrequency(year)
- getConstantsFromBPMN: Extracts the parameters from the JSON file that is used to describe the application architecture
- calcEnergyDemandFromAVG
- calcQFromAVG
- calcCarbonEmissionFromEnergyDemand
- calcCarbonBudgetFrom_AVG_CE
- getS_hourlyAVG
- calcEnergyBudgetHourInWeekAVG
- calcCarbonBudgetHourInWeekAVG
- calcED_LP
Each of these functions and its input parameters and output are explained as a comment at the start of their definition in lib.py.
