sahajsoft / docker-swarm-service-autoscaler

Scales the number of docker containers for service based on threshold(s) for metrics
MIT License
11 stars 6 forks source link

How to create multiple autoscaler service? #8

Open yuswitayudi opened 3 years ago

yuswitayudi commented 3 years ago

I've tried adding a service, and adding it to the autoscaler.yml config. but when I try to benchmark on the new service that I added not on the prometheus metric there is no grow up cpu usage. But when benchmarking the example_web application on port 8080, the application that I installed the cpu usage also went up.

This my example autoscaler.yml

poll_interval_seconds: 10
metric_stores:
  - name: monitoring
    type: prometheus
    prometheus:
      url: http://example_prometheus:9090
  - name: monitoring-backend
    type: prometheus
    prometheus:
      url: http://example_prometheus:9090
autoscale_rules:
  - service_name: example_web
    scale_min: 1
    scale_max: 3
    scale_step: 1
    metric_store: monitoring
    metric_query: scalar(avg(rate(http_requests_total{job="web"}[30s])))
    scale_up_threshold: 10
    scale_down_threshold: 5
  - service_name: netbrand-backend_netbrand-backend
    scale_min: 1
    scale_max: 3
    scale_step: 1
    metric_store: monitoring-backend
    metric_query: scalar(avg(rate(http_requests_total{job="web"}[30s])))
    scale_up_threshold: 90
    scale_down_threshold: 60

Thanks for your advice

javatarz commented 3 years ago

Hey @yuswitayudi, thanks for reaching out. I'll need a couple of days to reach out internally to see who has context on this project and can answer your query.

The orginal committer of this project isn't at @sahajsoft anymore and this project is from before my time. Sorry for the delay!

yuswitayudi commented 3 years ago

Hey @javatarz, thanks for your response.