-
Notifications
You must be signed in to change notification settings - Fork 188
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
Kepler general energy metrics vs energy tracing metrics #365
Comments
thank you @williamcaban for the investigation and proposal
This is surely a concern for us. If Prometheus cannot support a small setup, the metrics scheme needs a scalability study.
This can be investigated in two ways: exposing the general use case through metrics or supporting them via Prometheus query. Again, these approaches are to be evaluated via usability and scalability factors. |
Let's create a process for metrics schema:
@sustainable-computing-io/reviewer |
Right, I do agree that we need a metric that sum the energy consumption of all sources: This metric will represent the container_energy = package+ucore+dram+gpu+other_components |
Regarding the number of metrics. We have some ideas of disabling some metrics via configuration. However, just keep in mind that |
thank @williamcaban for sharing me the setup.
It has the latest metrics: kepler_pod_energy. I ran some quick tests and did find quite some issues: |
@williamcaban regarding the large prometheus metric being too expensive to process, I created a new metric in PR #370 |
@rootfs definitely there is something wrong with this deployment. In my environment the kepler CPU utilization is not high.... |
The empty cgroup values might be related to this fix (PR#377) |
@williamcaban @marceloamaral Here is my controlled test results. The TL;DR is, there is a scalability regression in the current code, kepler's CPU usage is very sensitive to the number of Pods. |
looking at this block, there are quite some map to create and discard after use. Creating map and letting it go to garbage collection is quite expensive. containerMetricValuesOnly, containerIDList, containerGPUDelta := c.getContainerMetricsList()
// use the container's resource usage metrics to update the node metrics
nodeTotalPower, nodeTotalGPUPower, nodeTotalPowerPerComponents := c.updateNoderMetrics(containerMetricValuesOnly)
// calculate the container energy consumption using its resource utilization and the node components energy consumption
// TODO: minimize the number of collection variables, we already have the containerMetrics and NodeMetrics structures
c.updateContainerEnergy(containerMetricValuesOnly, containerIDList, containerGPUDelta, nodeTotalPower, nodeTotalGPUPower, nodeTotalPowerPerComponents) |
Based on the profiling result, gc is an issue |
Thanks @rootfs for the excellent profile analysis.
@rootfs I didn't create new maps I just refactored the ones that already exist to be transparent what we're using. |
@marceloamaral |
you are thinking this is a regression? |
@rootfs I agree 100%. And that is why I included the These arrays are used in the model package because the model server only works with arrays. |
Based on the CPU profile results, I also analyzed the MEM profile at #391. |
👋 Prometheus team member here. Though I'm not in expert in client code instrumentation and I've only skimmed over the issue, I can probably share some information :) Projects like kube-state-metrics encountered similar issues in the past (and kubelet/cAdvisor to some extent). In practice, kube-state-metrics alleviated the problem by implementing a custom Prometheus client library (see the metrics_store and metricshandler packages). kubernetes/kube-state-metrics#498 has also lots of details on why building a custom metric client was the right choice for the project. |
Thanks @simonpasquier for the pointers! |
Btw, the PR #427 introduces a 2.4X performance improvement for Kepler regarding the CPU profiling. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Is your feature request related to a problem? Please describe.
The recent changes in the kind of metrics exposed increase the level of visibility to trace how much energy is consumed by which elements on a process/Pod/container. This kind of metrics is valuable for applications owners looking to optimize the energy consumption by their application or services stack. At the same time, the granularity of these metrics make it extremely difficult for functionalities that require a quick understanding of the system (e.g. schedulers, multi-cluster level dashboards, etc) and considerable increase the load on the Prometheus stack.
Describe the solution you'd like
I like to propose for Kepler to have a flag that can be use to influence the type of metrics that it exposes on the metric endpoint. Basically, enable Kepler to be used by general use cases (e.g. report the top-5 energy consumption by namespace, pods or apps; report the software+OS-view energy consumption by nodes, etc) and another mode for developers that want to do low level tracing of energy consumption of their apps.
The mode for the general use cases should provide a simple single metric per container or Pod, that can be used for user facing reporting and executive types of reports.
Describe alternatives you've considered
With the current granular metrics:
%timeit
) to load. With the previous aggregated metrics, the same cluster setup with the same datasets and resolution was loading in less than 1 second.Additional context
The general use cases should also cover #301
The text was updated successfully, but these errors were encountered: