Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

碳排放是如何计算出来的。 #824

Open
clin4 opened this issue Jun 17, 2023 · 1 comment
Open

碳排放是如何计算出来的。 #824

clin4 opened this issue Jun 17, 2023 · 1 comment
Labels
kind/bug Something isn't working

Comments

@clin4
Copy link

clin4 commented Jun 17, 2023

Describe the bug
开发者们你们好,我正在为我们公司做一些 Cloud Carbon report/footprint 的工具调研。目前正在评估crane. 之前看了一篇文章
如过这篇文章的描述是正确的,https://www.cncf.io/blog/2023/03/27/model-view-and-reduce-your-workload-carbon-emission-by-crane-in-a-declarative-way/,通过代码观察,感觉描述的和实际做的不是完全一致。希望能解惑。

  1. 只有关于CPU的能耗和碳排放,并没有看到文章里说的内存,存储和网络相关的能耗,碳排放的数据
  2. 我的理解是已经有了一个CloudCarbonFootprint Object, 需要手工配置,可是从代码看起来,完全是硬编码。这个有没有进一步的时间表。
  3. 在文章中关于优化的那一部分,能看到一个到每个workflow的能耗和碳排放的图表,但是从我看到的crane的版本,目前只有一个cluster 级别的能耗和碳排放。去哪里能看到文章说的版本。另外到workflow 粒度的碳排放是如何计算的呢?是按比例划分的吗?
  4. 试图理解CPU的能耗和摊排放计算,
    文章中说
    AverageWatts = MinWatts + AverageCPUUsage * (MaxWatts – MinWatts)
    CPUEnergyConsumption = AverageWatts * RunningHours
    从代码看到是
http://localhost:9090/undefined/api/v1/prometheus/query_range?end=1686940364&query=((sum(label_replace(irate(container_cpu_usage_seconds_total{container!=""}[5m]), "node", "$1", "instance",  "(^[^:]+)") * on (node) group_left() max(kube_node_labels{label_beta_kubernetes_io_instance_type!~"eklet", label_node_kubernetes_io_instance_type!~"eklet"}) by (node))
/
SUM(kube_node_status_capacity{resource="cpu", unit="core"}  * on (node) group_left() max(kube_node_labels{label_beta_kubernetes_io_instance_type!="eklet", label_node_kubernetes_io_instance_type!~"eklet"}) by (node)))
*
(3.84 - 0.743) + 0.743)
*
(SUM(kube_node_status_capacity{resource="cpu", unit="core"}  * on (node) group_left() max(kube_node_labels{label_beta_kubernetes_io_instance_type!="eklet", label_node_kubernetes_io_instance_type!~"eklet"}) by (node)))
*
0.581
&start=1686335564&step=1h

我的理解是
[0.743 + (containers 的 cpu 使用率合 / 总核数)*(3.84-0.743)] * 总核数 * 0.581 (碳排放系数)
不知道这样理解对不?

不知道有啥更好的方式联系你们,如果有其他方式请告知。谢谢

Reproduce steps

Expected behavior

Screenshots

Environment (please complete the following information):

  • K8S Version: [e.g. 1.19]
  • Crane Version: [e.g. 0.1.0]
  • Browser [e.g. chrome, safari]
@clin4 clin4 added the kind/bug Something isn't working label Jun 17, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jun 17, 2023

You may look for issues:

  1. 50% 成本是怎么计算出来的 #807

🤖 By issues-similarity-analysis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant