Pointers on using this with Hetzer Vms and bare metal #73
Replies: 8 comments
-
This is a longer one :) Let me get back to you on this once we have recovered from EcoCompute. Just a question for the meantime: Did you try the parameter auto discovery? What values are you getting? Which ones could not be discovered? Try: |
Beta Was this translation helpful? Give feedback.
-
Hey @mrchrisadams now had the chance to revisit this post. Could you try the In general using the CLI there are these two variants: 1. Auto modeIf you do not much about the system use the If you are on a VM you will get wrong parameters as you can only see the ressources assigned to you. The model will set the The result is that your VM, which is a slice of a big bare metal machine, looks like a much smaller bare metal machine. The estimated value for energy will in turn be off. But the energy curve will be the one of an actual machine and also sport it's non-linear behaviour. 2. Manual modeIf you can find the data sheets of the machine you are working on the manual mode is preferred. Here you must set the parameters to the one of the actual bare metal machine and then use the Assuming your machine is a Epyc 7002 and the infos from Hetzner indicate that they use the 8-core variant (See AMD data page and Hetzner page). What we do is we look at what the maxium available VM size is and then assume that that is the bare metal variant. In the Hetzner case the biggest machine for the CPX plans is a shared 16 vCPU. This means the machine has 16 Threads, which are shared (Hyperthreads). The full machine thus has 8 cores and 16 threads. The If you would craft it manually the CLI for the shown AMD cpu string would look like this:
Since you have no info about the exact model the TDP is unknown. You would not set the CPU frequency from AdditionalSee also an example how we set the values for the Github machines here: https://github.com/green-coding-solutions/eco-ci-energy-estimation/blob/1fcfe95976c4f8a78e3248be5072ad4797610d42/scripts/vars.sh#L50 SummaryLet me know if that explanation is helpful and please add any findings that came up for you. It would be great to add this to the documentation to help other users. Thanks for making such a detailed question! |
Beta Was this translation helpful? Give feedback.
-
Hi @ArneTR, sorry about the slow reply. I'll post a representative output for types of instances we are using:
app1, representatative of a CPX31 instance
app2 - representative of CPX21 instances
db2 - representative of a CX51 instance
mon1 - representative of CX21 instances
I realise this expects some streaming output to turn utilisation figures into energy numbers here, and see this in the readme.
In this case here, would the compiled static binary be this one here? The docs suggest that are, but I wasn't sure. https://github.com/green-coding-solutions/green-metrics-tool/tree/main/metric_providers/cpu/utilization/procfs/system |
Beta Was this translation helpful? Give feedback.
-
Thanks for the As said: You can use
Just compile it with This is mentioned under: https://github.com/green-coding-solutions/spec-power-model?tab=readme-ov-file#demo-reporter I see from the discussion that our documentation is not as good as we would like it to be :( I would really love to take some pointers from you what you found confusing and how we can improve! If you can also a PR for the documentation would be very happily accepted :) |
Beta Was this translation helpful? Give feedback.
-
Since you are setting the model on your machines maybe a pointer to an adjacent project that might also be lacking some awareness and documentation. What we do with these mini clients on our Hetzner machines is that we all stream their data to our product It is basically a data-drain that accepts inputs from all our tools:
You can then see all or your infrastructure (Servers, Pipelines, MacBooks etc.) in one summarizing view. Example for us: This view shows you the Carbon Cost of the actual webserver that delivers https://metrics.green-coding.io/ + some of our pipelines we run on Github. We have not integrated all of our machines, but it is possible! In order to leverage this feature for your pipelines specifically you need to set the values:
See documentation here: https://github.com/green-coding-solutions/eco-ci-energy-estimation Effectively you would have to add these three values to your workflow. Please give me a separate ping if this is helpful to you and you maybe wanna integrate this in top. At the moment this is also a free feature with not data cap we provide. If you want to integrate this elsewhere it is of course also open-source and can be self-hosted. metrics.green-coding.io is just the service we provide for free atm. |
Beta Was this translation helpful? Give feedback.
-
I have also made some exemplary calculations in our CarbonDB Agent repository where we use a pre-caclulated energy lookup table for Hetzner machines. Maybe that is easier to digest :) If you are okay I would move this issue to a discussion. Let me know ... |
Beta Was this translation helpful? Give feedback.
-
Hi @ArneTR - I'm very happy to move this to a discussion. thanks for all your help! I hadn't quite appreciated the goal of CarbonDB, and that it makes creating a running total of carbon emitted by each machine or project fairly straightforward. Presumably, all I'd need is basically that CarbonDB agent running on every instance I have, using the correct values for the 'slice' of the hardware that each instance is allocated. There's a bit of work to make sure the agents have the correct tags and projects allocated, but that's mainly to allow filtering of data afterwards, presumably. Feel free to close or move this discussion. I've made a note to discuss some of this next week in person with you and @ribalba |
Beta Was this translation helpful? Give feedback.
-
Cool, moving it over. One side note: CarbonDB frontend has been massively reworked. A preview of it can be seen here: https://metrics.green-coding.io/carbondb.html |
Beta Was this translation helpful? Give feedback.
-
Hi Arne / Didi / other green coding folks,
Thanks for publishing this project - I have a couple of questions about using this to turn utilisation figures into power figures in watts, to turn into carbon figures later, and I hope you can help.
I'm looking at coming up with some numbers for a few VMs on Hetzner to work out some better figures for the green web platform. We mainly a mix of the following instance types:
I believe these run on a mixture of Intel® Xeon® Gold or AMD EPYC™ 7002 processors.
If it helps provide some useful context, you can see a sketch below of the setup. The db server is a cx51, we have a scalable pool of cpx21s as app server workers, and a monitoring box is a cx21.
Here are the things I'd appreciate pointers on.
Working out the threads and cores, and frequency
I think I can use
lscpu
used to query the underlying cpu for each machineFrom here, I'm assuming I'd use these values, as inputs for the spec power model, right?
Working out the vhost ratio
This I'm less confident about - I was under the impression the virtualisation / overcommitment ratio was usually obscured by cloud providers, and while companies like Hetzner have both dedicated VCPU variants as well as dedicated VCPU variants of virtual machines, I'm not sure how to represent this in when running this tool to turn utilisation figures into energy.
Do you have an example you have worked on before that I can use as a reference, or any pointers on how I'd estimate or otherwise account for the level of overcommitment of virtual CPUs to physical CPUs on a box?
Thanks and hope the eco-compute conference went well 👍
Beta Was this translation helpful? Give feedback.
All reactions