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

scale up with cpu utilization #6

Open
puspbhatt opened this issue Oct 8, 2018 · 7 comments
Open

scale up with cpu utilization #6

puspbhatt opened this issue Oct 8, 2018 · 7 comments
Labels
question Further information is requested

Comments

@puspbhatt
Copy link

Is there a way that i could make this autoscalable with the cpu utilization.

@endeepak
Copy link
Contributor

endeepak commented Oct 9, 2018

You can use any metric for autoscaling as long as that metric is capture in your metric store like prometheus.

Could you please provide more details on which metric you have captured in metric store and want to use for autoscaling

@puspbhatt
Copy link
Author

i was trying to take cpu and memory uses of swarm but i couldn't find any metric_query to capture. for example when cpu and memory goes above 70% it should spin up a new container.

@endeepak
Copy link
Contributor

endeepak commented Oct 10, 2018 via email

@puspbhatt
Copy link
Author

autoscale_rules:

  • service_name: example_web
    scale_min: 1
    scale_max: 3
    scale_step: 1
    metric_store: monitoring
    metric_query: scalar(avg(rate(container_spec_cpu_period{job="web"}[30s])))
    scale_up_threshold: 70 %
    scale_down_threshold: 30%
    i changed these parameter in autoscaler.yml, but it didn't work

@endeepak
Copy link
Contributor

endeepak commented Oct 10, 2018 via email

@endeepak endeepak added the question Further information is requested label Oct 10, 2018
@puspbhatt
Copy link
Author

100 - (avg by (instance) (irate(node_cpu_seconds_total{job="node",mode="idle"}[5m])) * 100)
I found this query to capture the cpu utilization of the swarm, when i run this query in prometheus UI it says no data.
Can you please help me with that.

@puspbhatt
Copy link
Author

what are the configuration changes that needs to be changed if we wanna autoscale for cpu uses. if possible can you please elaborate in bullet points, i am stuck when trying to set it up.
Thank you Deepak

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

No branches or pull requests

2 participants