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

Any additional configuration required to make Orbiter autoscale? #62

Open
jchariot opened this issue Jul 29, 2021 · 1 comment
Open

Comments

@jchariot
Copy link

This is my first time using Orbiter. Currently, I got this swarmtest.yml :

version: '3.7'

networks:
  my_docker_network:

services:
  orbiter:
    image: gianarb/orbiter
    command: /bin/orbiter daemon --debug
    ports:
      - 8000:8000
    volumes:
      - /var/run/docker.sock:/var/run/docker.dock
    deploy:
      placement:
        constraints:
          - node.role == manager
      mode: replicated
      replicas: 1
  web:
    image: nginx:alpine
    ports:
      - "0.0.0.0:80:80"
      - "0.0.0.0:443:443"
    volumes:
      - ./web:/var/www/web
    networks:
      - my_docker_network
    deploy:
      labels:
        - "orbiter=true"
      replicas: 1
  phpfpm:
    image: php:7.3-fpm-alpine3.9
    volumes:
      - ./web:/var/www/web
    networks:
      - my_docker_network
    deploy:
      labels:
        - "orbiter=true"
      replicas: 1

which I runs with: docker stack deploy -c swarmtest.yml myswarm

I see from docker service ls that they all came up:

$ docker service ls
ID             NAME              MODE         REPLICAS   IMAGE                    PORTS
fv0c3eea5g2n   myswarm_orbiter   replicated   1/1        gianarb/orbiter:latest   *:8000->8000/tcp
ez3r46p6l297   myswarm_phpfpm    replicated   1/1        php:7.3-fpm-alpine3.9
ne5fkzualf1x   myswarm_web       replicated   1/1        nginx:alpine             *:80->80/tcp, *:443->443/tcp

However, when I do a load test using wrk . I see the CPU of the server goes up but the apps never scale up and they always stay at 1 replica no matter what.

Additionally, does this look right?:

$ curl -v -X GET http://127.0.0.1:8000/v1/orbiter/autoscaler
Note: Unnecessary use of -X or --request, GET is already inferred.
*   Trying 127.0.0.1...
* Connected to 127.0.0.1 (127.0.0.1) port 8000 (#0)
> GET /v1/orbiter/autoscaler HTTP/1.1
> Host: 127.0.0.1:8000
> User-Agent: curl/7.47.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Thu, 29 Jul 2021 14:55:37 GMT
< Content-Length: 11
< Content-Type: text/plain; charset=utf-8
<
* Connection #0 to host 127.0.0.1 left intact
{"data":[]}

What are other things that I must do in order to make Orbiter autoscale?

@dazinator
Copy link

I have only just stumbled accross this project but I think the idea might be that orbitor provides a convenient web api to allow you to trigger the scale up or scale back down operation, it doesnt automatically decide to do the scaling on it's own. It mentions custom labels (in the Readme) that you must add against each service so that it can tell how many instances should be scaled up or down to, when you trigger the scale up or scale down operation by calling its api. If my assumptions are correct, you would need some other way to monitor performance of your services and then call the orbiter api with "up" or "down" to trigger the actual scale operation based on your own decision point / evaluation of your metrics.

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

2 participants