Skip to content

simple-limit and simple showed different CPU Requests #413

Open

Description

@patsevanton

Describe the bug
simple-limit and simple showed different CPU Requests

 ./krr simple -p https://vmselect.corp/select/0/prometheus --prometheus-label cluster -l prod -n istio-ingress --allow-hpa

 _____       _               _          _  _______  _____
|  __ \     | |             | |        | |/ /  __ \|  __ \
| |__) |___ | |__  _   _ ___| |_ __ _  | ' /| |__) | |__) |
|  _  // _ \| '_ \| | | / __| __/ _` | |  < |  _  /|  _  /
| | \ \ (_) | |_) | |_| \__ \ || (_| | | . \| | \ \| | \ \
|_|  \_\___/|_.__/ \__,_|___/\__\__,_| |_|\_\_|  \_\_|  \_\


Thanks for using Robusta KRR. If you have any questions or feedback, please feel free to reach out to us at
https://github.com/robusta-dev/krr/issues

Watch our latest video to optimize your workloads and save costs: https://www.youtube.com/watch?v=TYRA2QcDIuI



Running Robusta's KRR (Kubernetes Resource Recommender) v1.22.0
Using strategy: Simple
Using formatter: table

[20:33:37] INFO     Using clusters: ['yc-core-app-prod']                                                                                                                                                                         runner.py:284
           INFO     Prometheus URL is specified, will not auto-detect a metrics service                                                                                                                                           loader.py:55
           INFO     Trying to connect to Prometheus for yc-core-app-prod cluster                                                                                                                              prometheus_metrics_service.py:69
           INFO     Using Prometheus at https://vmselect.mos.corp/select/0/prometheus for cluster yc-core-app-prod                                                                                            prometheus_metrics_service.py:98
[20:33:38] INFO     Prometheus found                                                                                                                                                                                              loader.py:74
           INFO     Prometheus connected successfully for yc-core-app-prod cluster                                                                                                                                                loader.py:47
           INFO     Unable to check how much historical data is available on cluster yc-core-app-prod. Will assume it is sufficient and calculate recommendations anyway. (You can usually ignore this. Not all Prometheus       runner.py:225
                    compatible metric stores support checking history settings.)                                                                                                                                                              
           INFO     Listing scannable objects in yc-core-app-prod                                                                                                                                                               __init__.py:96
[20:33:40] INFO     Calculated recommendations for Deployment istio-ingress/istio-gateway/istio-proxy (using 4 metrics)                                                                                                          runner.py:211
           INFO     Result collected, displaying...                                                                                                                                                                              runner.py:347
                                                                                                                                                                                                              
Simple Strategy                                                                                                                                                                                               
                                                                                                                                                                                                              
CPU request: 95.0% percentile, limit: unset                                                                                                                                                                   
Memory request: max + 15.0%, limit: max + 15.0%                                                                                                                                                               
History: 336.0 hours                                                                                                                                                                                          
Step: 1.25 minutes                                                                                                                                                                                            
                                                                                                                                                                                                              
All parameters can be customized. For example: `krr simple --cpu_percentile=90 --memory_buffer_percentage=15 --history_duration=24 --timeframe_duration=0.5`                                                  
                                                                                                                                                                                                              
Learn more: https://github.com/robusta-dev/krr#algorithm                                                                                                                                                      
                                                                                                                                                                                                              
┏━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┓
┃ Number ┃ Namespace     ┃ Name          ┃ Pods ┃ Old Pods ┃ Type       ┃ Container   ┃ CPU Diff            ┃ CPU Requests         ┃ CPU Limits   ┃ Memory Diff ┃ Memory Requests          ┃ Memory Limits   ┃
┡━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━┩
│     1. │ istio-ingress │ istio-gateway │ 15   │ 60       │ Deployment │ istio-proxy │ +4.7399999999999975 │ (+315m) 4.0 -> 4.316 │ 6.0 -> unset │ -2595Mi     │ (-173Mi) 1000Mi -> 827Mi │ 1512Mi -> 827Mi │
│        │               │               │      │          │            │             │ (15 pods)           │                      │              │ (15 pods)   │                          │                 │
└────────┴───────────────┴───────────────┴──────┴──────────┴────────────┴─────────────┴─────────────────────┴──────────────────────┴──────────────┴─────────────┴──────────────────────────┴─────────────────┘
                                                                                                 0 points - F                                                              

and

./krr simple-limit -p https://vmselect.mos.corp/select/0/prometheus --prometheus-label cluster -l prod -n istio-ingress --allow-hpa

 _____       _               _          _  _______  _____
|  __ \     | |             | |        | |/ /  __ \|  __ \
| |__) |___ | |__  _   _ ___| |_ __ _  | ' /| |__) | |__) |
|  _  // _ \| '_ \| | | / __| __/ _` | |  < |  _  /|  _  /
| | \ \ (_) | |_) | |_| \__ \ || (_| | | . \| | \ \| | \ \
|_|  \_\___/|_.__/ \__,_|___/\__\__,_| |_|\_\_|  \_\_|  \_\


Thanks for using Robusta KRR. If you have any questions or feedback, please feel free to reach out to us at
https://github.com/robusta-dev/krr/issues

Watch our latest video to optimize your workloads and save costs: https://www.youtube.com/watch?v=TYRA2QcDIuI



Running Robusta's KRR (Kubernetes Resource Recommender) v1.22.0
Using strategy: Simple_Limit
Using formatter: table

[20:33:46] INFO     Using clusters: ['yc-core-app-prod']                                                                                                                                                                         runner.py:284
[20:33:47] INFO     Prometheus URL is specified, will not auto-detect a metrics service                                                                                                                                           loader.py:55
           INFO     Trying to connect to Prometheus for yc-core-app-prod cluster                                                                                                                              prometheus_metrics_service.py:69
           INFO     Using Prometheus at https://vmselect.mos.corp/select/0/prometheus for cluster yc-core-app-prod                                                                                            prometheus_metrics_service.py:98
           INFO     Prometheus found                                                                                                                                                                                              loader.py:74
           INFO     Prometheus connected successfully for yc-core-app-prod cluster                                                                                                                                                loader.py:47
           INFO     Unable to check how much historical data is available on cluster yc-core-app-prod. Will assume it is sufficient and calculate recommendations anyway. (You can usually ignore this. Not all Prometheus       runner.py:225
                    compatible metric stores support checking history settings.)                                                                                                                                                              
           INFO     Listing scannable objects in yc-core-app-prod                                                                                                                                                               __init__.py:96
[20:33:51] INFO     Calculated recommendations for Deployment istio-ingress/istio-gateway/istio-proxy (using 4 metrics)                                                                                                          runner.py:211
           INFO     Result collected, displaying...                                                                                                                                                                              runner.py:347
                                                                                                                                                                                                                            
Simple_Limit Strategy                                                                                                                                                                                                       
                                                                                                                                                                                                                            
CPU request: 66.0% percentile, limit: 96.0% percentile                                                                                                                                                                      
Memory request: max + 15.0%, limit: max + 15.0%                                                                                                                                                                             
History: 336.0 hours                                                                                                                                                                                                        
Step: 1.25 minutes                                                                                                                                                                                                          
                                                                                                                                                                                                                            
All parameters can be customized. For example: `krr simple_limit --cpu_request=66 --cpu_limit=96 --memory_buffer_percentage=15 --history_duration=24 --timeframe_duration=0.5`                                              
                                                                                                                                                                                                                            
Learn more: https://github.com/robusta-dev/krr#algorithm                                                                                                                                                                    
                                                                                                                                                                                                                            
┏━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┓
┃ Number ┃ Namespace     ┃ Name          ┃ Pods ┃ Old Pods ┃ Type       ┃ Container   ┃ CPU Diff            ┃ CPU Requests                       ┃ CPU Limits   ┃ Memory Diff ┃ Memory Requests          ┃ Memory Limits   ┃
┡━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━┩
│     1. │ istio-ingress │ istio-gateway │ 15   │ 60       │ Deployment │ istio-proxy │ -33.165000000000006 │ (-2.2110000000000003) 4.0 -> 1.789 │ 6.0 -> 2.803 │ -2595Mi     │ (-173Mi) 1000Mi -> 827Mi │ 1512Mi -> 827Mi │
│        │               │               │      │          │            │             │ (15 pods)           │                                    │              │ (15 pods)   │                          │                 │
└────────┴───────────────┴───────────────┴──────┴──────────┴────────────┴─────────────┴─────────────────────┴────────────────────────────────────┴──────────────┴─────────────┴──────────────────────────┴─────────────────┘
                                                                                                        0 points - F                                                                              

Activity

  1. patsevanton commented on Mar 17, 2025

    @patsevanton
    ContributorAuthor

    Different:
    simple 4.0 -> 4.316
    and
    simple-limit 4.0 -> 1.789

  2. mouad5-bot commented on Jun 17, 2025

    @mouad5-bot

    Hello, Any response ?

  3. aantn commented on Jun 18, 2025

    @aantn
    Contributor

    Hi @mouad5-bot, are you encountering this too?
    @patsevanton just to confirm, both scans ran at the exact same time?

  4. patsevanton commented on Jul 12, 2025

    @patsevanton
    ContributorAuthor

    @aantn yes, same time

  5. patsevanton commented on Jul 12, 2025

    @patsevanton
    ContributorAuthor

    it is different strategy. Need change readme

  6. added a commit that references this issue on Jul 20, 2025
    55e7d58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions