How sustainable is our cloud infrastructure?

Mitchell Homer
Accurx
Published in
5 min readJul 5, 2024
Photo by Dan Meyers on Unsplash

Carbon emissions are the first thing that came to my mind when considering our infrastructures environmental impact.

If you’re using cloud services like us here at Accurx, then you might know that Azure provides some tools to make carbon emission data more tangible.

Azure Carbon Emissions increase to 7.7kgCO2 a month
https://learn.microsoft.com/en-us/azure/carbon-optimization/overview

I was interested in the information for regions in Europe after seeing our recent increase in emissions in September 2023, to determine if there are greener alternatives for our build and deployment machines.

Most of us can imagine what our local city or country uses to generate power but what about how this infrastructure operates day by day. Such as: “How much water is required to cool the server hardware?” or “how much of the localised region is powered via renewable energy?”

These values are reported by Microsoft as PUE (Power usage effectiveness) and WUE (Water usage effectiveness) where the lower the value, the better.

Some examples to consider for regions close to us:

Values from March/April 2023

Unfortunately they don’t (currently) publish information for UK South (our region), so it makes comparison difficult without some additional data…

Thats where these tools prove useful:

Using the free data access to ElectricityMaps in my free time, I collected hourly carbon-intensity data on a few European regions. The overall data can be seen below.

Hourly “carbon intensity” for 5 european Azure regions over a 3 day period. Data provided by ElectricityMaps API using the carbon-aware-sdk project.

This paints a different picture than I was expecting, as you can see that Ireland(northeurope) and Netherlands(westeurope) regions are WORSE than our current region London(uksouth) for almost every data point over this 2 weekday period!

Looking closer at the ElectrictyMaps web UI (really great btw) you’ll see some more information on the standout regions of France & Norway!

Average data for the month of March 2024 from ElectricityMaps

Azure’s France region seems marginally lower on Carbon emissions, however with the heavy use of Nuclear Energy and with some reliance on Gas, West Norway is arguably the more “green” option being backed by a high % of renewable energy in the form of Hydropower.

The reason for calling either “greener than the other” is arguable, as it depends on factors such as:
Hydropower — land use; impacting biodiversity and risk of flooding.
Nuclearpower- mining and processing of Nuclear fuel.

… and probably many more complex reasons that I’m not informed enough to comment on 😃

Can we swap Azure regions?

✅ CI/CD Infrastructure:

  • 👍 We self-host our Build and Deployment VM’s on Azure in the same region as our infra (uksouth). But in reality we don’t really care about the small latency differences to copy the built images ready for deployment.
  • 👍 I don’t need to worry about data privacy, as none of our sourcecode/build artefacts will contain anything sensitive!

🛑 Databases/Storage/Kubernetes:

  • 👎 Data privacy and legalities restrict us from storing or handling user data in regions outside the UK for now!
  • 👎 If latency or ping is a concern its not a great approach, as you could be sacrificing speed.

💷 Cost :

  • ⚠️ Virtual Machine Reservations are region specific! so if you’re looking to move workloads between regions and you’ve got Reservations it might not be cost effective to do it immediately.

What we did:

It was definitely feasible (I did some e2e tests running workloads on a different region) to move machines over to Norway or a lower carbon emitting region, but this required some disruptive changes and could potentially impact our existing financial commitments to infrastructure in uksouth.

However over the last 6 months, a project to reduce costs across our Azure infrastructure has had a huge impact! Some focus areas were:

Virtual Machines:

  • 📉 “Right sizing” Virtual Machine disk & CPU/Memory based on workload
Our Build & Deploy machine infrastructure
Our Kubernetes clusters running dev/staging/prod services
  • 💵 Adjusted reservations based on scaling changes and historical usage.
  • ⏩ Various pipeline improvements to reduce consumption of machine time.

Blob Storage:

  • ❄️ Move to “cooler” storage Tiers where possible, enforced by IAC.
  • Adding policies for regularly deleting old data
Storage in Pink :)

Monitoring:

  • 📣 Moved away from verbose logging & Kusto Queries, to a metrics based approach to monitoring. Using Prometheus/Grafana and OpenTelemetry.

All of these resulted in a notable reduction in carbon emissions which can be seen here 🌲:

Total emissions for our Azure Subscription!

Going from 7.5 kgCO2 -> 3.3 kgCO2 over the course of a 6 month period! 🎉

Looking forward:

There are some great resources provided by the Green Software Foundation. Following the newsletter can help keep informed on new initiatives or things to consider for your projects. Since writing my initial findings here I saw some posts in the newsletter that got me thinking of longer-term strategies to further reduce climate impact:

If you’re interested in joining Accurx as an engineer, take a look at our other engineering blog posts or visit our careers page for current roles. You can help connect people across healthcare.

--

--

Mitchell Homer
Accurx
Writer for

Software Engineer, currently doing DevOps at accuRx