Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions content/blog/adventures-in-dc-measurement.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ If you wann get the details of our journey, why we are integrating it into our t
## Why?

Current energy measurement in software that works in a small time resolution is mostly done in with
[RAPL](https://01.org/blogs/2014/running-average-power-limit-%E2%80%93-rapl) interfaces.
[RAPL](http://web.archive.org/web/20190220011235/https://01.org/blogs/2014/running-average-power-limit-%E2%80%93-rapl) interfaces.

Typically either [directly](https://web.eece.maine.edu/~vweaver/projects/rapl/) or through tools like [Scaphandre](https://github.com/hubblo-org/scaphandre).

Expand Down Expand Up @@ -95,7 +95,7 @@ The linux measurement client is a breeze and signals looked directly accurate wi

For inital testing we opted for a simple 0.5 Ohms inline shunt resistor that is measured in the differential measurement mode.

The code for importing the measurements is very simple Python. If you want to have a look at it, you can find it in our [dev branch](https://github.com/green-coding-solutions/green-metrics-tool/blob/dev/tools/dc_converter.py).
The code for importing the measurements is very simple Python. If you want to have a look at it, you can find it in our [dev branch](https://github.com/green-coding-solutions/green-metrics-tool/blob/1c085bf4/tools/dc_converter.py).


## Judgment of the measurement quality
Expand Down
24 changes: 12 additions & 12 deletions content/blog/blauer-engel-green-metrics-tool.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ socialmedia_preview: "/img/social-media-previews/blue_angel_certification_300.we
*Please find the english version below*


Wir freuen uns, dass unser Green Metrics Tool nun mit dem renommierten **Blauer Engel** für Ressourcen- und Energieeffiziente Softwareprodukte ausgezeichnet wurde.
Wir freuen uns, dass unser Green Metrics Tool nun mit dem renommierten **Blauer Engel** für Ressourcen- und Energieeffiziente Softwareprodukte ausgezeichnet wurde.

Diese Zertifizierung unterstreicht unser Engagement für Nachhaltigkeit und Innovation in der Softwareentwicklung.

### Was ist die Blauer Engel Zertifizierung?
Der Blaue Engel ist das offizielle deutsche Umweltzeichen, das seit 1978 vergeben wird.
Es legt strenge Standards für Produkte und Dienstleistungen fest und fördert umweltfreundliche Praktiken.
Der Blaue Engel ist das offizielle deutsche Umweltzeichen, das seit 1978 vergeben wird.
Es legt strenge Standards für Produkte und Dienstleistungen fest und fördert umweltfreundliche Praktiken.
Für Software stellen die Richtlinien DE UZ-215 sicher, dass zertifizierte Produkte:

- Energie- und Datensparsam sind
Expand All @@ -35,7 +35,7 @@ Weitere Informationen über die Zertifizierung und den Zertifizierungsprozess fi


### Über das Green Metrics Tool
Unser Green Metrics Tool wurde entwickelt, um Organisationen verwertbare Einblicke in ihre Umweltauswirkungen zu ermöglichen.
Unser Green Metrics Tool wurde entwickelt, um Organisationen verwertbare Einblicke in ihre Umweltauswirkungen zu ermöglichen.
Durch die Analyse des Ressourcenverbrauchs, des Energieverbrauchs und des CO2-Fußabdrucks hilft das Tool Unternehmen, datengestützte Entscheidungen zu treffen, um ihren ökologischen Fußabdruck zu verringern.

Zu den wichtigsten Funktionen des Green Metrics Tool gehören:
Expand All @@ -46,12 +46,12 @@ Zu den wichtigsten Funktionen des Green Metrics Tool gehören:

Die Zertifizierung bestätigt, dass das Green Metrics Tool nicht nur die Bemühungen um Nachhaltigkeit unterstützt, sondern auch umweltfreundliche Designprinzipien verkörpert.

Weitere Informationen über das Green Metrics Tool finden Sie auf der Produktseite des Tools: [Green Metrics Tool Produktseite](/prudcts/green-metrics-tool/)
Weitere Informationen über das Green Metrics Tool finden Sie auf der Produktseite des Tools: [Green Metrics Tool Produktseite](/products/green-metrics-tool/)


## Warum ressourcen- und energieeffiziente Software wichtig ist

Der Energieverbrauch und die Kohlendioxidemissionen des globalen IT-Sektors steigen rapide an, so dass die Effizienz von Software ein wichtiger Teil der Lösung ist.
Der Energieverbrauch und die Kohlendioxidemissionen des globalen IT-Sektors steigen rapide an, so dass die Effizienz von Software ein wichtiger Teil der Lösung ist.

Nachhaltige Software, wie das Green Metrics Tool, hilft dabei:
- Senkung des Energieverbrauchs für Software
Expand All @@ -68,15 +68,15 @@ Die Förderung einer breiteren Akzeptanz umweltfreundlicher Praktiken in der Tec



---
---

*English version of the blog article*

We are thrilled to announce that our Green Metrics Tool has now been certified with the prestigious **Blauer Engel** certification for resource- and energy-efficient software (DE UZ-215).
We are thrilled to announce that our Green Metrics Tool has now been certified with the prestigious **Blauer Engel** certification for resource- and energy-efficient software (DE UZ-215).
This certification underscores our commitment to sustainability and innovation in software development.

### What is the Blauer Engel Certification?
The Blauer Engel (Blue Angel) is Germany's official environmental label, established in 1978.
The Blauer Engel (Blue Angel) is Germany's official environmental label, established in 1978.
It sets standards for products and services, promoting environmentally friendly practices. For software, the DE UZ-215 guidelines ensure that certified products:

- are energy and data efficient
Expand All @@ -88,7 +88,7 @@ Achieving this certification means that a product meets the requirements for sus
Please find some more details about the certification and it's process in our [Services page for the Blue Angel](/services/blauer-engel/)

### About the Green Metrics Tool
Our Green Metrics Tool is designed to empower organizations with actionable insights into their environmental impact.
Our Green Metrics Tool is designed to empower organizations with actionable insights into their environmental impact.
By analyzing resource usage, energy consumption, and carbon footprint, the tool helps businesses make data-driven decisions to reduce their ecological footprint.

Key features of the Green Metrics Tool include:
Expand All @@ -99,12 +99,12 @@ Key features of the Green Metrics Tool include:

The certification validates that the Green Metrics Tool not only supports sustainability efforts but also embodies eco-friendly design principles.

Please find some more details about the Green Metrics Tool on it's product page: [Green Metrics Tool product page](/prudcts/green-metrics-tool/)
Please find some more details about the Green Metrics Tool on it's product page: [Green Metrics Tool product page](/products/green-metrics-tool/)


## Why Resource- and Energy-Efficient Software Matters

The global IT sector's energy consumption and carbon emissions are growing rapidly, making software efficiency a critical part of the solution.
The global IT sector's energy consumption and carbon emissions are growing rapidly, making software efficiency a critical part of the solution.

Sustainable software, like the Green Metrics Tool helps:
- Reduces energy usage for software
Expand Down
2 changes: 1 addition & 1 deletion content/blog/cloud-energy-usage-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ and not so quickly subject to change (Servers have 4-5 years lifetime).
## Getting energy data directly

Very few vendors allow this and actually the only one we know that provides direct access to IPMI for tenants in it's
cloud offerings is [Blockheating](https://blockheating.com/). Here you get bare metal machines with also access to IPMI.
cloud offerings was [Blockheating](http://web.archive.org/web/20230624233405/https://blockheating.com/). Here you get bare metal machines with also access to IPMI.

If you do not know what IPMI is and how to read the data, check out our [Metrics Provider for IPMI](https://docs.green-coding.io/docs/measuring/metric-providers/psu-energy-ac-ipmi-machine/) in the [Green Metrics Tool]({{< relref path="products/green-metrics-tool" >}}).

Expand Down
18 changes: 9 additions & 9 deletions content/blog/containers-on-macos-for-gmt.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ This is a quite high level overview and discussion and in no way complete.
<img class="ui large floated right rounded bordered image" src="/img/blog/linux-containers.webp" alt="Diagram of linux containers architecture" loading="lazy">
{{< /rawhtml >}}

First we need to discuss how docker works in it’s native environment, Linux. Docker uses features in the Linux kernel called [namespaces](https://en.wikipedia.org/wiki/Linux_namespaces), [cgroups](https://en.wikipedia.org/wiki/Cgroups) and many more. This technology enables processes to only see certain parts of resources previously allocated to them. Like this every docker process can be isolated from the rest of the operating system and only manage what has been allocated. The vita point is that the docker container basically runs in an isolated part of the Linux kernel.
First we need to discuss how docker works in it’s native environment, Linux. Docker uses features in the Linux kernel called [namespaces](https://en.wikipedia.org/wiki/Linux_namespaces), [cgroups](https://en.wikipedia.org/wiki/Cgroups) and many more. This technology enables processes to only see certain parts of resources previously allocated to them. Like this every docker process can be isolated from the rest of the operating system and only manage what has been allocated. The vita point is that the docker container basically runs in an isolated part of the Linux kernel.

This is in contrast to “classical” virtualisation. Which builds a totally new operating system, incuding kernel etv, on top of the so called host system.
This is in contrast to “classical” virtualisation. Which builds a totally new operating system, incuding kernel etv, on top of the so called host system.

A super simplified view on how the Docker container is run

Expand All @@ -35,32 +35,32 @@ This is in contrast to “classical” virtualisation. Which builds a totally ne
<img class="ui large floated right rounded bordered image" src="/img/blog/macos-vm-containers.webp" alt="Diagram of macOS containers architecture" loading="lazy">
{{< /rawhtml >}}

Because docker can not rely on namespaces on other systems like Mac it needs to do a little trick.
Because docker can not rely on namespaces on other systems like Mac it needs to do a little trick.

Just to mention it: Windows is a special case and will be discussed in another article once we port the Green Metrics Tool to windows (at some stage).

To run docker containers on Mac docker uses a virtual machine that runs Linux. So it adds a totally new operating system via virtualisation.


You can see this in the Docker desktop app which gives you the option to either use the new [virtualisation framework](https://developer.apple.com/documentation/virtualization) from apple or [qemu](https://www.qemu.org/). If you don’t know about apples virtualisation framework is is worth a read as it lets you spin up VMs with ease.
You can see this in the Docker desktop app which gives you the option to either use the new [virtualisation framework](https://developer.apple.com/documentation/virtualization) from apple or [qemu](https://www.qemu.org/). If you don’t know about apples virtualisation framework is is worth a read as it lets you spin up VMs with ease.

Looking at your processes running on your host you can’t see any containers as they are encapsulated in the VM. The only thing you see is the VM as you can see from this line from `ps`

```bash
501 15207 15188 0 9:06PM ?? 0:25.61 /Applications/Docker.app/Contents/MacOS/qemu-system-aarch64 -accel hvf -cpu host -machine virt,highmem=off -m 8092 -smp 4 -kernel /Applications/Docker.app/Contents/Resources/linuxkit/kernel -append page_poison=1 vsyscall=emulate panic=1 nospec_store_bypass_disable noibrs noibpb no_stf_barrier mitigations=off linuxkit.unified_cgroup_hierarchy=1 vpnkit.connect=tcp+bootstrap+client://192.168.65.2:52436/6bd3c43205d2e38a101ff4a22191af5bb947845a420aaad097305ef937474f33 vpnkit.disable=osxfs-data console=ttyAMA0 -initrd /Applications/Docker.app/Contents/Resources/linuxkit/initrd.img -serial pipe:/var/folders/dz/z2d2thkj76j2fxm_932w8qn80000gn/T/qemu-console2891520672/fifo -drive if=none,file=/Users/didi/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw,format=raw,id=hd0 -device virtio-blk-pci,drive=hd0,serial=dummyserial -netdev socket,id=net1,fd=3 -device virtio-net-device,netdev=net1,mac=02:50:00:00:00:01 -vga none -nographic -monitor none
```

An interesting point is that docker is using the Arm emulation binary [qemu-system-aarch64](https://www.qemu.org/docs/master/system/target-arm.html) as all containers I am running are build for arm. This might become a separate article in the future but for now the main points are that you can build containers for different architectures and docker will always try to use the one for the arch it is running on. It is however possible to run containers that are build for different architectures as we are running everything in a VM and qemu can pretty much emulate [anything](https://www.qemu.org/docs/master/system/targets.html).
An interesting point is that docker is using the Arm emulation binary [qemu-system-aarch64](https://www.qemu.org/docs/master/system/target-arm.html) as all containers I am running are build for arm. This might become a separate article in the future but for now the main points are that you can build containers for different architectures and docker will always try to use the one for the arch it is running on. It is however possible to run containers that are build for different architectures as we are running everything in a VM and qemu can pretty much emulate [anything](https://www.qemu.org/docs/master/system/targets.html).

## So what does this mean for you as a user:

Docker on Mac will always be slower as running docker on Linux. Through adding the extra virtualisation layer it creates quite an overhead when running anything in docker. But the docker tool does quite a good job at hiding all the nifty details.
Docker on Mac will always be slower as running docker on Linux. Through adding the extra virtualisation layer it creates quite an overhead when running anything in docker. But the docker tool does quite a good job at hiding all the nifty details.

## And for running the Green Metrics Tool on Mac:

The Green Metrics Tool (GMT) relies on Docker to isolate the single components that are needed to
The Green Metrics Tool (GMT) relies on Docker to isolate the single components that are needed to

a) run the support infrastructure for measuring like DB and our Web frontend
a) run the support infrastructure for measuring like DB and our Web frontend

b) run the actual app in containers so we can measure the impact each piece of the app has

Expand All @@ -70,5 +70,5 @@ As on Mac everything is isolated in a VM that isn’t easy to connect to from th

- Shows how to replace the linuxkit vm with something you built yourself: [https://www.codeluge.com/post/setting-up-docker-on-macos-m1-arm64-to-use-debian-10.4-docker-engine/](https://www.codeluge.com/post/setting-up-docker-on-macos-m1-arm64-to-use-debian-10.4-docker-engine/)
- [https://zarinfam.medium.com/what-are-the-advantages-of-the-new-virtualization-framework-in-macos-big-sur-7685c3aca0f7](https://zarinfam.medium.com/what-are-the-advantages-of-the-new-virtualization-framework-in-macos-big-sur-7685c3aca0f7)
- [https://www.ginkgobioworks.com/2022/07/19/using-docker-on-apple-silicon/](https://www.ginkgobioworks.com/2022/07/19/using-docker-on-apple-silicon/)
- [https://www.ginkgobioworks.com/2022/07/19/using-docker-on-apple-silicon/](http://web.archive.org/web/20240813031315/https://www.ginkgobioworks.com/2022/07/19/using-docker-on-apple-silicon/)
- [https://earthly.dev/blog/using-apple-silicon-m1-as-a-cloud-engineer-two-months-in/](https://earthly.dev/blog/using-apple-silicon-m1-as-a-cloud-engineer-two-months-in/)
4 changes: 2 additions & 2 deletions content/blog/cpu-utilization-mac.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ This works and gives you realistic values. You can check this quite quickly with
If you reduce the time to under 500 ms, that the script should wait till it loops, you start getting `0` values as `host_statistics` returns the same data. It is not exactly 500 ms and it varies on machines but around that time it starts returning the same values.

Apple is notoriously bad at documenting their software but it looks like the kernel just updates the data every *n* ticks. Which makes sense from a performance perspective. Normally you wouldn't need a higher resolution. We looked how other tools implement getting cpu data and even `psutil` [[1]](https://pypi.org/project/psutil/) has the same problem. You can see the details in the
[bug report](https://github.com/giampaolo/psutil/issues/2368) that we filed.
[bug report](https://github.com/giampaolo/psutil/issues/2368) that we filed.

Doing more research there is actually some caching int the [`host.c`](https://gitea.com/matteyeux/darwin-xnu/src/branch/master/osfmk/kern/host.c#L342) file that caches the results but I didn't do a deep dive why the statistics are not updated.
While the implications are minor we didn't want to ship code that would not perform with a high resolution on MacOS. After some searching around we found that [htop](https://github.com/htop-dev/htop) uses the `host_processor_info`[[2]](https://developer.apple.com/documentation/kernel/1502854-host_processor_info) kernel call which internally uses the `processor_info`[[3]](https://opensource.apple.com/source/xnu/xnu-792/osfmk/mach/processor_info.h.auto.html) call which also gives you the cpu load statistics on a per processor basis. And this gives a far higher resolution. So we can rewrite the code to look like:
While the implications are minor we didn't want to ship code that would not perform with a high resolution on MacOS. After some searching around we found that [htop](https://github.com/htop-dev/htop) uses the `host_processor_info`[[2]](https://developer.apple.com/documentation/kernel/1502854-host_processor_info) kernel call which internally uses the `processor_info` call which also gives you the cpu load statistics on a per processor basis. And this gives a far higher resolution. So we can rewrite the code to look like:

```C
void loop_utilization(unsigned int msleep_time) {
Expand Down
2 changes: 1 addition & 1 deletion content/blog/dena-study-green-coding.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ Als Experten für nachhaltige Softwareentwicklung sehen wir die immense Bedeutun

Nachhaltigkeit ist kein isoliertes Thema, sondern erfordert gemeinsame Anstrengungen und Kooperationen. Deshalb freuen wir uns auf die Zusammenarbeit mit Deutsche Energie-Agentur GmbH (dena) . ✨

Außerdem vielen Dank an unser Konsortium [Hochschule für Technik und Wirtschaft Berlin](https://www.htw-berlin.de/), [SYNGENIO AG](https://syngenio.com/), [bluehands GmbH & Co.mmunication KG](https://www.bluehands.de/), [envite consulting](https://www.envite.de/), [DVC - Digital Venture Consultants](https://www.dvc.ventures/), [oktobit](https://oktobit.de/) und [metafinanz Informationssysteme GmbH](https://metafinanz.de/) 🍀
Außerdem vielen Dank an unser Konsortium [Hochschule für Technik und Wirtschaft Berlin](https://www.htw-berlin.de/), [SYNGENIO AG](https://syngenio.com/), [bluehands GmbH & Co.mmunication KG](https://www.bluehands.de/), [envite consulting](https://www.envite.de/), [DVC - Digital Venture Consultants](https://dvc.ventures/), [oktobit](https://oktobit.de/) und [metafinanz Informationssysteme GmbH](https://metafinanz.de/) 🍀


Loading