I was at a tech un-conference today and there were a couple Python people in discussions about digital environmental sustainability (of the web specifically but also interested in other areas). This made me wonder who else is working on technology’s climate impact in the Python world? Are there any specific PSF initiatives / interest groups working on this?
I’m interested in any possible existing work. For example:
Conference carbon footprints (do PyCons report that?)
Carbon footprint of CPython’s Continuous Integration
Power consumption benchmarking of different software
Feature roadmaps of various open source projects to reduce their users’ carbon footprint
From my side I’m approaching this in the context of Django. There are about 50-500k projects built with the framework. Total carbon footprint is on the order of 100-500k tons of CO2 equivalent per year. So any improvement we could make to the framework would go a long way in reducing the industry’s carbon footprint. Or also making improvements by sharing relevant resources with Django users.
How are these numbers estimated? If there was no Django would we save that amount?
I ask because I commented on a LinkedIn post from someone stating that switching to Rust would save power because it is faster, but they gave no figures - as if it is self evident??
I think one needs to measure. If Django were 10% more efficient, leading to a 0.01% power saving, (figures are random), would it be worth developing that efficiency change in Django, (with the added need to debug the changes)?
that isn’t per se true. but assuming that an efficient Python implementation (thus it’s not using Django) is compared with an efficient implementation with a language that compiles to native CPU instructions, you’d need less server capacities for a web service with the latter.
this also assumes that the resource exhaustion caused by porting and maintaining that more efficient implementation doesn’t outweigh the savings.
regarding your examples, i think it makes sense to categorize these into must-avoid and must-reduce categories.
for shipping speakers and audiences to conferences by aircraft there’s no carbon-free alternative. this just needs to stop. it’s simple.
regarding the computational power consumption, this needs to ensure to use clean energy (note that Microsoft, on whose CI and hosting many rely on, is about to re-open a nuclear power plant far away from their headquarters) and it needs to be massively reduced so that clean energy capacities can replace current use of fossil fuels.
Great to see there’s interest in this! I’m not aware of much Python usage in mobile apps but yes that’d certainly be good to be more efficient.
This is based on the Sustainable Web Design model, which attempts to quantify server, network, and client device energy use for websites. Source data is my own crawl of the web + HTTP Archive dataset + CrUX report, I can share more numbers if it helps
If there was no Django – I presume the majority of those sites would still exist, built with other tools. The emissions would be for those other tools to worry about (and yes could be lower or greater).
Re Rust, yes, it’s pretty clear switching to a more performant programming language for equal use leads to lower energy usage. Most CPUs consume less energy when idling than at 100% utilization (though not nothing), and if CPU usage is lower it also makes it possible for sites to provision a server with less beefy hardware.
However this is one of many factors, not a silver bullet.
In a web environment, maybe the need to run a database may take the lions share of resources anyway?
Yes that’s occasionally the case, depends lots on the architecture. The database often is “always on”, while web servers can be scaled on/off according to traffic.
for shipping speakers and audiences to conferences by aircraft there’s no carbon-free alternative
well, I imagine you’re aware of this already but online events and travel by train are clear alternatives