Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: Measure CO2 emissions of your APIs (stepci.com)
20 points by Wissmueller on Nov 15, 2022 | hide | past | favorite | 6 comments
Have you ever wondered about the carbon footprint of your API?

This week, the 27th climate summit takes place in Egypt. This inspired us to draw attention to the emissions produced by our online behaviour.

We introduced some CO2-related features to our API testing tool:

  - Calculate carbon emissions of an API call
  - Set up a check to validate that your API endpoint doesn't cross the limit when it comes to emissions
  - Test all your API endpoints and get an approximate calculation of your API emissions in total
We hope that by using these features, you will become more aware of the carbon footprint of your infrastructure and act accordingly. You could for example switch to a sustainable hosting provider.

http://github.com/stepci/stepci




The first question I have is: how? How do you calculate this?

Its’s neither obvious from your post nor your GitHub landing page, which is a shame.

The other question I would have is: who is the target audience, and why are API calls specifically so important?


The page linked by the HN post title (https://docs.stepci.com/guides/co2-testing.html) says:

> The calculation algorithm is provided by Sustainable Web Design

And links to: https://sustainablewebdesign.org/calculating-digital-emissio...


That page:

> NOTE: This page is regularly updated to include the most recent research and information.

Also, the same page:

> Last update: April 17, 2022.

Call me naive but I was hoping research in this area will be faster/more frequent, given also the Cop27.


> Annual Internet Energy / Annual End User Traffic = 0.81 kWh/GB

> Carbon factor (global grid): 442 g/kWh

Probably just checking how many bytes the response is. While that's a good idea to remove unused data from your response, this test may promote wrong patterns such as spreading data over multiple request/response. This would consume more energy but won't be visible with a naive CO2 computation.


that’s correct, we should also mention that spreading data over multiple requests does not improve co2 usage


Raising awareness on such topic and providing visibility to devs is a good thing. Unfortunately, numbers may be off by multiple orders of magnitude. It's really hard to get any meaningful CO2 number for a single API call. I'd suspect API burn much more CO2/byte than streaming.

Streaming is dumb, cacheable near end-users and heavy in bandwidth. API uses little bandwidth but often requires calls to multiple remote backend systems heavy in CPU, including subrequests to databases and other stuff. When you mix all usage and get an average KPI, it's no longer representative.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: