GithubHelp home page GithubHelp logo

optionalg / marathon-lb-autoscale Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mesosphere/marathon-lb-autoscale

0.0 2.0 0.0 66 KB

Autoscale your apps on Marathon

License: Apache License 2.0

Ruby 100.00%

marathon-lb-autoscale's Introduction

marathon-lb-autoscale

This is an example of how to use marathon-lb to implement request rate based autoscaling with Marathon. This should work with any application which uses TCP traffic and can be routed through HAProxy.

Marathon-lb-autoscale will collect data from all HAProxy instances to determine the current RPS (requests per second) for your apps. The autoscale controller will then attempt to maintain a defined target number of requests per second per app instance. Marathon-lb-autoscale will make API calls to Marathon to scale the app.

Incredible diagram

How do I use it?

Usage: autoscale.rb [options]

Specific options:
        --marathon URL               URL for Marathon
        --haproxy [URLs]             Comma separate list of URLs for HAProxy. If this is a Mesos-DNS A-record, all backends will be polled.
        --interval Float             Number of seconds (N) between update intervals (Default: 60)
        --samples Integer            Number of samples to average (Default: 10)
        --cooldown Integer           Number of additional intervals to wait after making a scale change (Default: 5)
        --target-rps Integer         Target number of requests per second per app instance (Default: 1000)
        --apps [APPS]                Comma separated list of <app>_<service port> pairs to monitor
        --marathonCredentials [MarathonCredentials]
                                     Colon separated string of <username>:<password>
        --haproxyCredentials [HAProxyCredentials]
                                     Colon separated string of <username>:<password>
        --threshold-percent Float    Scaling will occur when the target RPS differs from the current RPS by at least this amount (Default: 0.5)
        --threshold-instances Integer
                                     Scaling will occur when the target number of instances differs from the actual number by at least this amount (Default: 3)
        --max-instances Integer      Maximum number of instances an app may be scaled to (Default: a huge number)
        --min-instances Integer      Minimum number of instances an app must have (Default: 1)

Common options:
    -h, --help                       Show this message

Running on Marathon

{
  "id": "marathon-lb-autoscale",
  "args":[
    "--marathon", "http://leader.mesos:8080",
    "--haproxy", "http://marathon-lb.marathon.mesos:9090",
    "--apps", "nginx_10000"
  ],
  "cpus": 0.1,
  "mem": 16.0,
  "instances": 1,
  "container": {
    "type": "DOCKER",
    "docker": {
      "image": "mesosphere/marathon-lb-autoscale",
      "network": "HOST",
      "forcePullImage": true
    }
  }
}

marathon-lb-autoscale's People

Contributors

brndnmtthws avatar chrispeterson avatar qburst-amal avatar atoulme avatar robfrut135 avatar tkrausjr avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.