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

Krr since 1.5.X does not return recommendations #174

Closed
agabrys opened this issue Dec 5, 2023 · 4 comments
Closed

Krr since 1.5.X does not return recommendations #174

agabrys opened this issue Dec 5, 2023 · 4 comments

Comments

@agabrys
Copy link

agabrys commented Dec 5, 2023

Describe the bug
It is a continuation of #127. Unfortunately, I cannot reopen the issue.

Our Prometheus scrapes all requried metrics (#150):

  • container_cpu_usage_seconds_total
  • container_memory_working_set_bytes
  • kube_replicaset_owner
  • kube_pod_owner
  • kube_pod_status_phase

When I execute a command as follows

krr simple --verbose --kubeconfig kubeconfig--perfx-k8s--agabrys.yaml --namespace monitor-operator --history_duration 1 --timeframe_duration 2

I get different results depending on the used version.

Version CPU Recommendations Memory Recommendations Logs (Gist)
1.4.1 Yes Yes krr-simple-1.4.1
1.5.3 No Yes krr-simple-1.5.3
1.6.0 No No krr-simple-1.6.0
1.6.0 (34974bf9) No No krr-simple-1.6.0-dev-34974bf9

The metrics were collected by the test environment for around 3 hours (should be fine because I set --history_duration to 1 hour).

To Reproduce

  1. Setup test environment where Prometheus scrapes:

    • container_cpu_usage_seconds_total
    • container_memory_working_set_bytes
    • kube_replicaset_owner
    • kube_pod_owner
    • kube_pod_status_phase
  2. Wait at least 1 hour, so historical data can be collected

  3. Execute

    krr simple --verbose --namespace <your-namespace> --history_duration 1 --timeframe_duration 2

    with using different versions

Expected behavior

Recommendations should be calculated.

Are you interested in contributing a fix for this?

I can help with testing. I learned how to build the software.

Desktop

  • Computer:
    • OS: Microsoft Windows 10.0.22621
    • Platform: Win32T
  • Shell: PowerShell 7.4.0
@hofmann-dev
Copy link

I have exactly the same problem, and when I use version 1.4.1, it works like a charm.

@arikalon1
Copy link
Contributor

thanks for reporting it @agabrys & @hofmann-dev
We're checking it

@LeaveMyYard
Copy link
Contributor

So basically at some point we added a minimum amount of data points the simple strategy requires for calculation. This is done to not give recommendations on very small amounts of data. By default it is set on 100 points.

For your case , if you want 1 hour data with 2 minute timeframe (that's 30 points) you can set --points_required 15 (it will filter pods having only 30 minutes of data, as `points_required * timeframe_duration = 15 * 2 minutes = 30 minutes)

Also you can do --points_required 1 to use all available data

But I personally would not recommend using only 1 hour of data in general case, as from personal experience that is not enough.

@agabrys
Copy link
Author

agabrys commented Jan 17, 2024

Oh, I did not take that into account. I ran KRR 1.6.0 on production today and everything seems fine 🥳
It means that adding the recommended metrics is sufficient 🥳

But I personally would not recommend using only 1 hour of data in general case, as from personal experience that is not enough.

That was my test environment. I use a longer time period in production. I will remember to set --points_required 1 for testing 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants