 All right, I think we're good door is kind of closed. So I will start some people might be dropping in Yeah, so hello everybody. I'm Arna I'm the founder of green coding Berlin and I will be presenting today an open source tool Which which you can measure Arbitrary software so I don't know if in which talks you have been today so far But I for instance have seen a talk where there was a lot about software bloat and how a software is not Efficiently designed because we live in a scaling economy and stuff like this So I will be talking mostly today about just measuring and about transparency of software in particular So first of all the slide what so what is the green metrics tool? As the title of the talk already given is an open source software tool that is able to measure the energy and in particular Also the co2 consumption of the software that you either as developers have or it can also consume consumer software Somebody else has written It measures typical parameters that you know as developers, which is like network IO, but it can also measure Stuff like CPU energy. It can also measure DRM energy. It can measure hard disk energy in particular and AC DC power Some of you who work with yeah in German I don't many people have maybe German don't see these terms Gleichstrom Wechselstrom, so it really depends on where you take the signal of the electricity that you want to measure It measures these according because you some of you are probably developers, so you know that measuring software is tricky So it measures this with the concept of a standard usage scenario So this is very important for the cause of the talk. So this is why I explain it here a bit If you think of a typical software, let's say a user land software that everybody uses like telegram or what's app, right? And you want to compare these two they obviously have different Functionalities, so it's it's bitch you very easily get in a situation where you're comparing apples to oranges, right? And the thing with the standard usage scenario in particular is that is you you define a use case or workload that holds true for 80 80 percent of the users So let's make an example with a word application So you say what do you typically do with the word application you open it you write a one-page document You maybe print it you make some fonts fat You maybe introduce a nice word art or clippy the nice mascot of Windows 95 So something like that which holds true for 90 percent of the users and this allows you to compare Softwares given a use case against each other because it's obviously tricky to compare notepad to word, right? Because they have very different feature sets so that the one application uses more it's kind of typical So this is why we have used the concept of standard usage scenario Which actually originates from the work around the blue angel for software if you're if you know that The tool has a visualization on board because you want to see aggregate metrics You want to see changes over time and has an API on board which I will talk about later because picture is an open API later On that everybody can query data from The question also arises why why why did we build the green metrics tool? So here about the technical parts. So measuring software and energy consumption was possible before the green metrics tools There are other tools which can do so scar founder can do so tools from the Intel Intel power gadget can do so AMD has a tool that they are all kind of very isolated very targeted to the infrastructure and not very targeted to software developers in particular So our goal is to make it as easy as running a CI CD pipeline So you just fire it off you can reuse infrastructure files that you already have so I come from web perspective So I think about Development processes very often I think about Google Lighthouse which makes it easy to see if your website is performing well We want to have the process Not exactly like this, but it won't have it as easy as that measuring software is complex So best practices for measuring are typically tough So many people are probably here engineering students are at the two billion or have studied engineering before So you know that measuring can be very tricky because you have to cater for very Strong and fixed boundary conditions because if you just put a program on this machine I absolutely cannot compare it to anything else on any other machine before I know the boundary conditions where I'm in So we create our tool to set them for you basically based on research or empirical best practices Why did we will to green matrix tool part two? Comparing software is complex. So this is what I shared before basically when talking about telegram and WhatsApp So software must be classified and attribute it automatically because I can make these use cases It was very specific softwares, but when I will I mean given the plurality of software that there are millions of different Softwares out there everybody has to classify it manually. So this is obviously not working So the framework has to do it for you so it has to and identify what the software Generally does to put it in same baskets with different software to make it at least comparable given certain boundary conditions We're measuring the transparency on the energy consumption. Sorry. We are missing transparency on the energy consumption of software so The dream with our tool is that because it's open source and will when people would use it a measure of software You will have an idea of what a typical application consumes. So probably nobody of you knows By firing up word how much word actually consumes in terms of energy and what kind of CO2 this is However, you might know it for your car because there's typically or at least for some people a buying decision You might know it for your fridge At least you might know the energy rating of your fridge, but you don't don't do this for software coming back to this later So what is the concept of the tool? So before I dive into screenshots, I have to talk a bit dry stuff and then we see actually some some stuff Which some of you can probably better relate to By catering for these boundary conditions that I told before what we do and I will just go quickly over it And we can talk about it later So so we think we have quite an ample time for Q&A is we package the software and containers So we leverage some functionality that Linux has on board To isolate the applications as good as we can and to get the most reproducible metrics as good as we can for people who are not developers I tried to put it here in a graphic that Makes you understand of what a web application is comprised of so if you use something like Eco greater or you use something like website carbon many couple of people maybe know it is a service where you plug in your website Just the URL it's a form box and it tells you okay by going to this website you would You have produced or there was an end budget occurred of 0.5 grams of carbon right because all the electricity the network transfer etc. It's up to a certain carbon budget What this only tells you these tools is only this right part So it only tells you what the browser is sending to you in terms of network However, it's probably everybody of you knows there is also a server that actually delivers this website So here we're talking about the left part So when we talk about Benchmarking or measuring an application with our tool We always want to look at the whole distribution that is possible So here we're talking about a very easy distribution. It's just a front-end part So the right part the chrome browser and it's a server part So here we're talking about database which stores the data whatever you're looking at Let's say you go to Facebook so that the post and everything is in there and a server That's basically delivering the data in a format that the browser can understand and our tool orchestrates all these three containers Isolates them from each other queries these metrics separately that you need to understand What is actually going on there and also to need to get the energy and it puts them in docker containers This is I would say technicality here in particular But the isolation is the important part and also the firing it up and firing it down because then you can also see when the application starts So boot times obviously a phase and when it cycles down Going one slide further I'm going to keep it short because I know people hate you ML diagrams in general But what you can see on the left side is that there is something ingested So you have architecture files that you typically use docker files You have kubernetes files, which I have to say kubernetes is not yet supported but coming to the later on But you will have at some point kubernetes You can consume a docker compose file or it could also terribly technically consume a terraform file or whatever you feed in Whatever you already have and then you give it a flow that you typically also already have so people typically have Unit tests of some sort they have end-to-end tests either in selenium code seption whatever Session replays you can think of it whatever you already have for your application Typically to keep the quality of the application in check But you can feed that indirectly because it typically you test what you believe is important and what people typically use in your application So this is what you also have to look where the most energy where where the least energy should be drawn Then it's put into the green matrix tool. So this is our logo extremely creative You probably have seen this breakfast before and it orchestrates these containers containers are measured And then this is based in the metrics that you that you want to collect and it puts it out into apis So I think the most important point that you see here is that stuff is ingested So we try to reuse stuff that developers already have so not create another very Complex tool and everything we output comes out as a pause extreme So you can feed it to a file you can feed it to a grafana dashboard You can feed it to an api wherever you wanted to so every one of these reporters is Separately reusable if everybody thinks and you're also happy to contribute. I'm coming on this later if you think hey I can do this better. I want to reuse something from it. You can reuse the components all open source every free to free to use So how does the output actually look like and what is presented to maybe Non-extremely technically users but more like people in a management domain so to say I'm coming to normal users also later on So here is what the output looks like if you just look at the compound metrics So typically this is metrics you typically get from profiling applications where you get to network. Oh, you get the memory average And you get the CPU load and these are metrics that are also I would say easy to get technically measuring is The values are typically known every one of you knows kilowatt hours This is just milliwatt hours, so it's divided by a thousand and another thousand Then you you obviously can guess software incurs very lower values compared to like a vacuum which directly hits with one kilowatt hour So we've looked with one kilowatt if you let it run for an hour And here you see that this is the energy budget of the CPU This is the energy budget of the memory of the DRAM This is the memory budget of the network for people who have never seen how that network has an energy budget This is typically done when you say there's transfer happening and Because it has to go through routers. It has to maybe go over a satellite. It has to go to Through basically network components of any kind they are plugged into electricity into the electricity grid So they obviously have a network have an energy budget and tail to them This one you cannot measure directly You have to use a formula and the way you typically go is you take the kilowatt hour Sorry, the kilobytes or the gigabytes transferred you multiply it with a constant or with a dynamic factor You can get them out of papers You can get them out of databases and then you have an idea of what on average a network request would consume that has gone back and forth We make compound metrics out of it. I think this is Pretty clear you can add up CPU and memory and then you get to here Right, so I think this is very easy understandable, but also we measure at different points So so these measurements here we get directly from the CPU There is a modern infill CPUs and an AMD CPUs and nowadays also in many arm CPUs There is a kind of like a voltage regulator on the CPU which can tell you how much the CPU is currently consuming These values we measure outside of the system. So this is the AC power This is what you directly get from the wall plug So this is what you maybe have seen in your house when you want to say hey How much is my microwave using and you just plug this thing from Amazon on which is 20 euros or so? So we have this kind of like cable through the PC but in our lab But it gives the same reading and ATX energy is basically if you look at the main board after the PSU It's a technicality Just wanted to tell you if you look at the numbers here and you get the CO2 out of it Which basically comes out of the electrical energy. So you lose electrical energy as a proxy You look at your grid where you currently are. So let's say I am here in Berlin So we have a mixed grid So I would use a higher factor to get from kilowatt hours to energy if I'm in France I have a nuclear energy. I like use a lower factor and this factor you get out of an API Here you see also another part of the tool which basically tells you some overview metrics So I think the most important takeaway part is here is the duration and that we pin repositories So we picture that every software that is open source or in some form of Repository should be measured and it should be directly visible to other people. Okay at this point in time Sorry at at this point in time I will be looking at this repository and then I know what exact version of the software was measured What we could make here on top is also the hash of the current GitHub commit which would make it easier for developers But but you already have all the information that you need just looking at this to say, okay This is what was measured and here we have measured a Reproduction measurement of the blue angel for ocular Blue angel is a software certificate. I don't know of a talk by Jens Gruger for instance today has already happened So he has been talking about that and we've just reproduced a measurement with our tool to show that it's capable of Doing the certification process So yeah, the certificate pinning is the important part that you can look okay This is the software version that was measured and I can falsify myself So you don't have to trust our tool and the readings that it puts online on the free data Open API database This is a typical graph you get out of it So as I said in the top left charts obviously I think the charts itself doesn't tell you much What it tells you that here is a CPU utilization measured on container level a CPU utilization on a system level and There is also another chart which then gives you the energy and what I've done here in particular And I will cycle back and forth a bit is that you can see that energy and Utilization is very similar, but it does not necessarily align always So it can be depending on what instruction the processor issues or if there's currently a hold on the processor Like if it's currently fetching memory and cannot really do instructions You will get some deviation in these charts which depending on which granular granularity you want to measure on can be important for what you're doing You see here some other metrics which basically take away message here is and I said this before you have these plugins in our tool And you can also write a plug in yourself It's usually just 100 to 200 lines of code to get these metrics from somewhere and you can hook it into the tool And it will generate a graph out of it for you Which basically displays the usage over time for this specific resource. So here's CPU utilization memory total memory energy for Rappel MSR. This is this thing on the CPU the voltage regulator that I've been talking about Etc etc What kind of applications are supported with tool in particular? so The application that the tool currently supports is a desktop application like Firefox It is put in this container. They have told before But from there on you can use it normally so you can feed it any URL it has to go to You can also give it a plug in etc. And then get an energy budget out of it. It can take in command line applications This is particularly interesting because this also means that machine learning models are directly included So if you've ever worked with Python, it typically is just a call on the command line So this is what our tool can directly use And directly generate all this data from you if you just you just have to give it one line where it shall call the application It will fire up all the containers for you And you can obviously use web applications because this is where I came from and with the idea for the tool was originally born So here you have to do a bit more for the infrastructure file because you have to tell which server to use which image and How they are connected? But as said before you might have these files already because it can consume a standard Docker file Docker compose file. Sorry What can you do with it in terms of analysis? So I've told you now, okay these charts are coming out of it But what are we for instance looking in particular when we generate an application report, right? It's not just for a certification process. I want to do something actionable with it as a developer so Different code different scopes. So for a machine learning application that typically runs I don't know how big models couple of you build but the machine learning apps can run for a couple of days So typically you utilize all the resources anyway as much as you can so your CPU runs at 100% all the time You can just come in. It's not problem. You can also walk here behind me. If there's any if this is a fit Yeah, so for machine learning episode for running code you typically want to just get the energy budget You just want to know okay, how much does it even? Costs to run one training on my machine learning model or how much does inference on my model cost because oftentimes People don't really know they know what they are built by the cloud providers But they don't know the energy budget that is entailed with it And we believe that it becomes more important over time and we want to create also a tool that can bring this Transparency in the world. So just people know and society can make a decision on it Whatever that means, I mean it can be that it's okay for a machine learning model to consume 1000 terawatt hours if it has the right use case, right? For web applications, it's typically important to identify idling system So this is where if your web developers a concept like serverless typically comes into place So people should use serverless in order to get this idle time down But our application can tell you how bad it is really that your machines are constantly idling and you're not cycling your Machines down and where in the application workflow these idle times actually occur For algorithms, it's important to understand how your code behaves if your systems is differently configured So here it comes into play what I told before that if you want to measure on a very high granularity Then it is important to really not only look at CPU utilization create an idea of the energy from it But look at how your application behaves when it's configured differently for instance our tool shell It currently consumes just part of it, but it shall consumes all the typical parameters You have to set to make your measurement reproducible So a CPU typically cycles up and cycles down the frequency all the time It can go into turbo boost so it can even use a bit of more energy for a certain period of time to make like for instance Making the monitor like flipping it up and your PC response directly This typically has a bit of an energy cost because CPU can go into a turbo state very quickly to be very responsive But there's also more to the equation what a what a CPU in terms of features has that come along with it So here you see a typical memory anomaly that you would typically not get out of a formula So the typical formula that's currently used in the cloud is the more memory you use and here you see that the memory budget goes up The more memory you use the more energy you will consume so you more typically multiplied with a constant factor This is how it's done in tools like cloud carbon footprint or in the teats engineering model If you've heard that it's some models that people use to measure cloud energy at the moment because we don't have many Sensors available in the cloud, but you would expect the same qualitative shape on the right side because you see here This is memory energy and this is just memory total. So here you see a very different curve So this is what what I also these curves can can align this is not atypical that they align But this is kind of a memory anomaly you would say because you use more memory But actually the energy of the memory is not really consumed because So so you can you now have to drill down what the what the case here is in particular But it's mostly because memory is reserved, but there is no rights or eats happening in this one particular Then you have here a system that kind of has a creep over time So you see here that although I'm running a constant load in terms of CPU Which is not given here But you have to take my word that there is a constant CPU load behind it Is that the memory typically goes up over time as already the energy goes up over time Which is a normal feature of a CPU so the CPU gets hot There's a quadratic function for the transistors for a hot system to use more voltage and in turn more amps But then it also goes down a bit and this is because some instructions are already cached So you're still using high CPU utilization to query all the information But you you typically don't have to don't have to do costly compute anymore This is our current understanding of this code in particular What I don't want to give you here is an explanation why stuff is happening But I will I want to give you a view of how our tool can use to spot Something here and say okay What is actually going on here and is this even relevant even right because we are also talking Maybe not about strong jumps here in the data that you're seeing But you wouldn't have seen this before if you don't measure the energy over time What your code is actually doing because the CPU utilization was constant So you see here that there is difference in this one particular Going to the example that I had before with the service in particular as you can figure web servers are mostly idle, right? They are provisioned to have to handle a peak load But not always people are going to the website and using it constantly However, there can be another case which is quite confusing actually what we have here measured is that you see here This is how our green metrics tool displays it every color is a part of the Front-end back-end Tuple that I've told you before so blue is actually the web server which serves the HTML data Green is the puppeteer container. So this is the browser. This is chrome and yellow is the database and red is the notes So this is this stuff that you see here So you would expect that if you make a request to write so the browser Has a peak so we are looking at CPU utilization here So the browser has a peak in terms of utilization. So something is happening on the browser and then the server responds and It fetches something from the database and then displays it to the browser And the browser renders the page. So this is basically what happens here and then here is the next page coming and Here you would expect that here after the request has happened The systems should go to idle right the browser is actually going to idle the browser is not doing much So a bit of here, but it's so minimal But why is the web server constantly drawing CPU utilization? So what is it doing? I actually don't know Maybe there's also a good reason for it I having a web being a web developer for 16 years. No, I don't know the good reason. So it's it's but it's still interesting I mean Apache is usually a solid web server. So I would be curious of what's going on here But this is where I would be looking at If I were the developer and what we also want to do with the tool is that we want to have Users and developers challenging the developers and asking what is your tool actually doing here? I mean you have a good reason fine, but why do you use energy all the time if there's really nothing happening? Is this is for the good or is this for the worse could be prefetching resources, right? It could be doing something very logical, but it could also be like bad code So this is what you can for instance do with our tool and this is what you then can do as a user related on when you want to spot Problems in the application or why your batteries currently draining if you look into mobile What is our vision for the tool? So basically the road map that we want to have features coming in over the next couple of months or even longer So first of all technical features so we currently don't have Android application of Windows support quite interesting But since Android applications are already very optimized. This was not the first thing that we're looking at Distributed application which basically power most of what we have on the infrastructure cloud site at the moment. So typically Yeah, no relevant application is only run on one single node, right? Because we have to look at distributed applications in particular We can do this currently in Docker setups So if you use Docker swarm for instance or typically easy Docker container service this one works But Kubernetes for instance doesn't work and and other very strong distributed systems don't work So this is what we want to look at inline reporting is very important So I would really make a decision as a developer on a On a software just looking at the guitar repository and seeing a batch. Okay, this software uses For just its testing process Let's say one one ton of CO2 a day because it runs a thousand times a day It's a very large code base and it runs two or three pipelines in parallel for instance I Would make a decision for it if I were to know that right? So we want to make our tool to be pluggable in something like GitHub actions So where these CI CD pipelines typically run or as a git lab reporter where you can get an awareness of the testing costs We want to have energy splitting on the process level. I talked about this technicality before so currently we split the the energy by time on a For the energy we get from the CPU So you get the total energy of your system and you have to split it by time to account for only the process But also splitting on an instruction level is very interesting If you want to have the tool use in more granular environments So this is a very strong technicality, but I thought interesting for people who are a bit deeper in the in the material and we want to at some point like this is the Finish line so to say we want to provide recommendations for energy optimizations automatically so without you having a background in this field and looking at the charts and knowing exactly what is going on to see Okay, this is what I can do better the way that Google Lighthouse does it at the moment It tells you hey you're requesting this resource five times Although I've already seen it on the first page. You don't have to do that. This is what we want to do in our tool also Providing developers with answers so our tool is mostly tailored to developers at the moment But we want to shift to users at some point. We'll talk about developers now first So a typical developer question that comes up that we see in our meetups here in Berlin is that people ask Okay, I can do a static website But how much do I actually save compared to WordPress or I know about graph QL But is it so much better than rest just looking at the energy? I mean we've heard about response times can be faster and you don't over fetch but actually I Don't know like can you tell me is flask better than fast API like if If you're using flask or if you're using fast API, they are mostly identical for my use cases I've used them before both our frameworks where you can make an API with So how do I decide if all the boundary conditions are equal and I'm free to choose the most energy efficient framework How would I know I did it has currently not out there? And there is also not that many tools that can measure energy in general and we believe that our tool can be an answer for developers to answer this question and Graph QL ahead before This is for instance one Question and here you see that's the first question that we have tried to answer So we have made a case study on our website where we have built an identical site once was a static site builder So something that if you if you don't know what for instance WordPress does exactly WordPress is blogging platform Fetches the data from the database every time you request if it's not Particular configured but in the default mode it fetches the data every time you visit the page It generates the dynamic page all the time and you the template all the time in you and if you use a static site It just spurts out just just reading from the file system just spurts out the file as HTML and This is what is called Hugo. So this is the system we have been using and here you see WordPress So what you see here on the right side is that for one request on a page? WordPress consumes the amount of energy in and I think the value is jewels here that we're looking at but Even if we were to kill what ours at the the relative ratio counts So let's say it's jewels because this is also very this makes sense of this 10 jewels You see here that you you need to use 10 jewels just to deliver one page with WordPress however, if you have a static site you are at Around 1.5 jewels one fair point you have to say in order to generate a static site You have to build it at some point right it's just not there like WordPress all the time So the WordPress generates these sites fresh when a request come in so you have to Pre-create all the possible pages. So this year can be Can even go a bit up if you have like 10 variants of your web page that could be handled by this request in particular But the important takeaway message here is that for our system in particular where we had I think 30 sub pages This is the whole build of all 30 sub pages Sorry, I confused requests and built before so build is here left side and this is the actual request So for all the 30 sub pages This is all the cost that was needed to generate the whole page and then looking at one particularly page one particular page is This bar chart here and you can see the uncertainty range because we have made a couple of iterations It can even be so close to zero that our tool could not even measure it given the uncertainty could also be higher to be fair But what you see here is that you can easily generate 30 pages and make a full request when WordPress could not even handle a Fourth or fifth of a request in particular So this is the energy difference that we're talking about and WordPress is one of the if not even the most Used and most distributed web application that we currently have What is our vision for the tool for users so providing use of those answers for you as a user you typically want to say If I have a software given certain boundary conditions or users scenario How do they how do they compare and I will jump a bit? Forward because now reading it the question is a bit more too complex I want to show it to you in the picture So if you just look at telegram and what's that what would be interesting to you is say hey I know telegram uses less network IO and There's no actual data. This is a concept picture. So we have not measured anything here But it could be a typical outcome you say hey telegram always advertises It's using less energy and it uses less network because it saves so much in terms of images caches Whatever but in turn it uses more CPU in order to leverage these caches or to unpack data etc, etc and This is one possible visualization that could be consumed by a user because I have seen charts like this I don't know if you have seen these charts when I compare mobile phones So when I compare mobile phones and worse is calm I see okay It has it has bigger battery But in turn it does not have Wi-Fi 5 and in here it does not have Bluetooth 4 So it don't have to be these cryptic values here Which maybe are not in your daily life like typically not everybody looks at DC energy all the time But it could also be different values. They're saying for sending a message. It is at this point for sending a video It is at this point and then you look here to what's that we're sending a video is maybe out of the chart But sending a message is maybe lower right and they say hey, I'm just sending messages I'm a what's app user or I'm sending video telegram is better It really depends on the boundary condition if you can make these switches But currently you don't even have the data to make the decision So this is what we picture for is a user to consume our data So it will not be non-technical it would not be a no-brainer which just just use was app This is not coming out of it. I at least I don't believe that this is possible But if you want to make even though an informed decision our tool will hopefully be Give this information at some point if people use it as an open source tool and generate and measure these data Network level anomalies, so this is also a bit cryptic now because I want to make it Approachable to user. I'm probably going to reformulate it in the next iteration of the talk But what you are probably interesting or what's probably interesting for you as a user is just to see How often is my Facebook application or whatever application? Querying a service like how often is it's making update requests is it's making every five minutes Is this really necessary or is it even going to an ad service instead of just to graph that Facebook to fetch the latest messages Is it even going to? Hmm is it yeah, is it fetch fetching ads? This is basically what I want to say for instance because this is typically what you don't want to have of your application You want the functionality, but you don't want the app. You don't want the tracking You don't want the telemetry and you can see in our tool If this is really happening constantly or just one time a day or even at all So this is what I mean by transparency and also giving users choices and it can also issue a certificate So the blue angel for software is a possible certificate Which can which could be issued because this one applies some minimum standards that we that the blue angel wants to have for application like it has to Yeah, it has to have a minimum amount of energy that should be using at least in the next iteration I've had this chart before so this is hopefully a slide that is better consumable for users So if you if you want to take away something away from the slide What we believe could be the vision of the tool is that you can think of it as the yuka or the code check of software so typically when I Look at something That I buy from DM or I buy from Rossman I want to know if there's something in there that I don't want in particular I'm not allergic or so, but I don't want micro plastics for instance in in my shower gel So this is what you can do with code check code check directly tells you yeah If you want to drill down, this is all the special in car names that is in here But it also tells you with a red flag at the top contains micro plastics So so the typical warning signs that people really want to look for This we picture for our tool so a typical warning flag that could be is this software is or this data center of this Software are in Poland and Poland runs on cold power. So this might be a decision where you say no This is not acceptable for me It's it's okay if you use energy in general, but please host it at least somewhere where you have hyrothermal energy where you have solar power So so this is easily digestible it gives you a directly a binary decision basically so you say okay I don't support coal we can also say I don't support nuclear energy if this if this has a different concern for you Although it's in this contact of CO2 a positive energy form But this is what we want to have one have it at some point as easy as yuka and code check to make decisions for User just asking is there a more carbon-friendly alternative to my software or is there a software that makes less network request, etc, etc So this is the end of the talk and as I said before the software is open source and super happy to get Contributions or interest for you from you of any kind We do have a meetup group here in Berlin where we host free meetups for everybody use technical or non-technical We have had speakers like Chris from the green software foundation before the KDE team Which basically makes the KDE plasma desktop and they have been talking about their free and open source software approach with the blower angle And also some other green companies here from Berlin and also talks from us like all our projects how they are going along Yeah, we're looking for contributors in the tool But also super happy hit me up directly if you're just interesting the concept and want to have me explain more Or if you just want to talk to me on on green coding in general or something else Just also read me on LinkedIn or also write me an email whatever works for you in terms of a tool So thank you very much, and I hope we have time for questions Yeah, do you want to hand mics out sure let's do that one microphone, which is here. So you have to pass it I Would like to ask a little technical question. How does it work? Is it somewhat like a site? like a site container or Does working is inside of the container I'm currently working or on the host system and the second question there What is missing on Kubernetes or what is the difference that this doesn't work on Kubernetes? Oh, yeah so It works outside of the Docker container system So basically the Docker containers run all rootless and we are on the host system and we orchestrate these containers So we can control the Docker demon and orchestrate these containers And then we pull the metrics you can pull them with Docker stats technically we use a different approach We pull them out of the Linux subsystems out of the virtual file endpoints and then we can generate the metrics So we are not forwarding the endpoint inside of the Docker container to measure in there But it could be done Scaffolder for instance does it like so if you Google up later on Scaffolder is another tool that can measure energy It does it like so it however cannot do this orchestration part It just can forward this information in the container for you if you control the hypervisor So if you run Q emu somewhere for instance hats Now for instance does it you could forward it to the client into the hypervisor. So this is what our tool cannot do But Scaffolder for instance can Coming to a second question. Can you go again, please on the second question based on this technical things What is missing on on on Kubernetes? So what's the difference there because we have almost the same situation? Yeah Exactly. So so the files are very similar. Just supporting Kubernetes would be probably a very minor point the thing is that Kubernetes typically If you control the architecture yourself the change would be very minimal, right? But this would mean that you have to set up your own Kubernetes cluster, which people typically don't do So it would be nice if you can use a Kubernetes server Service right so you go to Google use that community service and then just use our tool Inside of it so to say if if you want to call it like so the problem And this is basically true for all the cloud services at the moment is that all these machines have locked down Certain points where we query data from so you cannot read rappel for instance This is the thing that info provides the running running average power limit because this is a register in the CPU There is only available in ring zero So you have to have kernel extension installed in Linux to get this information and this one is typically locked down So what we are doing at the moment before we go this one step further is we're trying to create a machine learning model that can Kind of estimate the information of energy based on the utilization metrics, right? This is what I said before that CPU utilization and energy doesn't always co-align We have to get that first down to make solid Predictions of what we are expecting the energy really to be and then we could plug it into the Kubernetes service Even running inside of the pot so it does not even running inside of the container So it does not have to be on the pot orchestrator level It can then be used inside of the container So this is the problem in general, but if you have Kubernetes self-hosted you could use the tool All right I'm not super experienced with the Rappel counters, but I thought they only allow for like system-wide Measurements and then my question would be how can you attribute the energy measurements to some sort of a certain application? Yeah, so This is what I had before in splitting by time and splitting by energy So an easy way and our tool does this currently in the deaf branch It's not in the main branch is that you just say you look at one minute of time You have two kilowatt hours So it's a very strong example here, but bear with me So I have two kilowatt hours and I have two applications running right and then I look at the information of CPU utilization And I see okay This application has run for let let's say it was one kilowatt hour This application has run for 10% of the time and the other application has run for 90% of the time right and then you would say Okay, this one is then 100 watt hours for this application And this is 900 watt hours for the other application or for just being being idle, right? So this is how you split by time. This however has the problem that time does not always as a Coalign with the work that is actually be done So you would assume that the instruction that the processor was issuing has a different energy budget entailed right there There are vector instructions which use very many registers. There's a pause instruction. There is a no op instruction So you would say Okay, it would be nicer to look at the instructions than just at the time because this gives me a more better idea Which work has actually been done right because the instructions kind of the unit of work Yeah, so so there's two ways to split it to be fair I have seen no implementation of instruction splitting so far. This is what we're currently working on But you probably need both the way we currently or we also need PSU energy, which is the energy that comes into the So yeah, if you don't know what a PSU is, I mean, it's this net style in German So it's basically the thing which converts the AC power to the DC power that the main board kind of stands and this one has losses and these not losses can be non-linear So they are typically not that strong if your system is running at full power But they make up most of the losses if your system is idling so you need this measurement point You need the measurement point on the main board and you need the measurement point in the CPU directly So this is why we see these two topics as very similar to generate all of these metrics at some point But to answer your question one sentence you can split by by instructions or you can split by time To my knowledge them, but there might be more. Okay. Thanks Thank you for the talk and two quick questions. One is do you or did you measure? Stream processing engines yet And or do you have a use case for that in your system? And the second one is do you plan on including GPU or TPU measurements? Well, we can include GPU measurements This is I've seen this very often you can do this with the Nvidia API TPU measurements. I you meant TPU, right? I'm I don't have any experience in that. I don't know if there is to mine. This is all ASICs, right? So you need some custom proprietary Framework if this even exists, I don't know if that exists but very interesting so if you work in that and you see it, please shoot me an email and We have not measured stream processing engines But I would encourage you to maybe use our tool to do so and publicize the data So it would be very interesting and what I've not talked about before so you can see this as as a second point So if you just want to go after the talk and see something and also see the upload form We basically hosted we host an Implementation of our tool on metrics green coding org so you can use it locally as an open source tool It will generate an own web server But if you want to see where we publicize all the measurements that we have done it is on metrics green coding org It looks a bit beta-ish though, but you will feel at home if you've seen the slides before All right any else Hello Well, congratulations on the work. Actually, I think it's really awesome I was going I was curious about Asking how will this affect if you are using many micro cloud services for example such as for many like file Management, it's completely different if you're just sending requests or if you are actually handling files Such as using Cloudinary or Firebase some stuff like that How will this be affected if you're using many cloud systems and if you are actually able to I think you kind of Mention it that you are not having completely access to the CPU because The cloud service naturally doesn't give you but how will this be affected? How can we have like a better outcome about using this? green coding So if you say how is this affected would are you asking me? How much the impact of all these services is that is put on top or if they will react to our measurements? I am hosting all the services or if I am using cloud services, okay yeah, this is a bit hard to tell and I had it I had this This is a bit hard to tell and I had a discussion with I Dean here in the audience before so if you want to hit him up about Cloud functions and how actually this goes on is a layer deeper so to say it's it's not the full service But it's already implementation of that So there is no data out of there and since most of these services are kind of proprietary We cannot tell so a next interesting step that we want to do is that we want to host at least the function as a Service platforms right which sit a layer deeper so you orchestrate or you set up your own server Made out of Amazon firecracker or you set up your own server made of the v8 worker engine from cloud for a and just see how the same application with the same workload the same usage scenario compares to a monolithic instance of Apache with JavaScript engine or service installed right so these two comparisons are super interesting because I'm a big fan of serverless actually, but I don't know how much it actually has a gain and we've asked Google we have asked cloudflare and They are currently not shared. They are not able to share so I Think the services are good, but they don't want to publicize or they don't even have the data So so this is what I can tell you from my personal experience Yeah, I'm just curious you mentioned that there's a note that saying what is the server and the database being activated over? Yeah, do you have an answer maybe might that be like web sockets or something related in this scenario not it It was just a really plain WordPress site. Wordpress has no web sockets to my knowledge But even if it is web sockets, right? Why is the data transfer going on all the time? It was not a chat application and there was nobody on the other end. So yeah right Yeah, so I would kind of love The idea to to have this in a CI pipeline running and checking how much energy consumption my code actually has I mean, what would I need to do to have this what I need to have a bare metal machine that actually runs? I mean, I would need a bare metal machine to have access to CPU Voltage APIs, right? Yeah, so I would have to set up a dedicated machine that runs your software and Yeah, well that there's a couple of ways to do it So last week and I think max has already left max from the sda. They hosted the hackathon last week with the Bundesamt with this topic was strong ongoing and what they provide for instance And I hope they will provide it to everybody in a bigger fashion at some point is that they have a dedicated GitLab runners so on GitHub you just take an Azure virtual machine and it runs it for you Which is quite nice. I really love the service, but this one has this lockdown problem So it uses the Microsoft Hyper-V hypervisor none of these registers is available So what you can do there is you can use a machine learning model with the estimation that we're currently working on So you have to wait a couple of weeks up and then use the model. So this will give you a good reading already However, if you want to host it yourself you can Plug this in GitLab for instance so in GitLab you can plug in a so-called GitLab runner And this would be configured the way that it gives you this information And there's currently a project from the sda a where they try to open source this concept of a GitLab runner So it's basically a docker orchestrator that For what scoffander and we had the you had the question before For what scoffander inside of this container and then you can read rappel inside of there So it's a privileged container that has this measurement available And then you just have to use one of our reporters and then you have it so it's Three hoops so it's not as easy as we wanted to be at some point But this is the current point in time where you could do that So yeah, so either you see sda a tool host it yourself plug it into GitHub or wait for the model that we're currently working on That's does that answer your question. Otherwise, please shoot Please show the follow-up but if you forward it into a container then you have the double problem that you also have to calculate the share of the Container compared to other runners doing the same thing on the same machine, right? The share of a container Well, I think the GitLab runner is Although it creates a container. It's it's an isolated VM. So so this this is on its own In general, you have this problem. So if you think about heroku, right? You and you create a machine learning model. You have a different operating point that you're on So if you estimate of CPU utilization, you can tell what your CPU utilization is But not the one of the whole package which might might have 10 cores. So this is a problem on its own We're trying to fix that but I can't tell you how good the model is at the moment because we're just gathering data at this point in time Yeah, but good question. Yeah, this is some an ongoing problem Actually when I'm in a in a bit process I can build big images or big big Docker builds or small ones Which are very heavy for the network at action. This was also a finger. We should could measure it, right? Yeah, you could measure that and there is actually a very good PhD thesis From Zandra Creighton if you ever looked that up at some point He has measured Docker build process in particular and they're very interesting findings in there Not only what you're talking about that the Docker cache, right? You don't download resources all the time like pip inside of the Docker container does not know which packages have been fetched It always refatches it, right? This is this is what you mean if you build something with stalker inside of there Three years ago. I tried it a little bit, but very naive way just counting my CPU usage and trying different Build strategies stacked one or the simple one. It's on it. Yeah There's really Jesus if you if you're five years ago the thesis has actually Docker uses Don't pin me. I think docus built pack now It's it's a new way of creating these images and this is way more energy efficient than five years ago And this is actually what he talks about in the thesis So look that up in particular But what you also has find that if you work with Docker you have typically docker run, right? Where you can just fire up a container from the command line or you can use docker compose and just these two tools Already have a five times energy budget So five times in difference of the energy budget that they use just to start this container not even talking about the build process So there's a lot going in there You could even use potman versus docker and look at this one in particular, right? Because they have different approaches how they built containers. So yeah, this is an ongoing topic and We are trying to create the data to make this more transparent So you don't have to make this tedious runs all the time But you get an overview picture of how do they generally compare? Yeah I Sandro Cretan K-R-E-T-E-N If you don't find it just hit me up and I will ask him if I can send you the thesis that I have But he has also a video on YouTube So if you look on YouTube Sandro Cretan He presents most of the stuff in there in an easy consumable 30 minutes format because the thesis as you can figure I think a thousand pages or so how these dr. Theses are yeah All right, all right cool time is up Thanks for this very interesting talk and for the hard work you have done Very exciting. So big applause to Arnold