GithubHelp home page GithubHelp logo

scale-experiment's Introduction

Auto Scaler

This is a experiment to build a Cloud Foundry Service that monitor apps, and scale them up or down depending on their CPU usage.

Its a naive aproach, what it does is just creates more instances when CPU > 90%, and deletes some when the CPU is < 40%, its just a prototye!

It uses GoBro as a lib, to expose itself as a broker in a Cloud Foundry instalation.

How to use

Clone the repo, push it as an app into Cloud Foundry and:

Enable the service

$ cf create-service-broker scale us3r passw0rd http://auto-scaler.domain.com
Creating service broker scale as admin...
OK
$ cf service-access
getting service access as admin...
broker: scale
   service       plan   access   orgs
   auto-scaler   cpu    all
$ cf enable-service-access auto-scaler
Enabling access to all plans of service auto-scaler for all orgs as admin...
OK
$ cf m
Getting services from marketplace in org virtu / space dev as admin...
OK

service           plans                                         description
auto-scaler       cpu                                           Auto Scaler Experiment

Use the service

User can now create a service and bind apps to it to have them auto-scale:

$ cf cs auto-scaler cpu scaler
Creating service scaler in org virtu / space dev as admin...
OK
$ cf bs myapp scaler
Binding service scaler to app myapp in org virtu / space dev as admin...
OK
TIP: Use 'cf restage' to ensure your env variable changes take effect

The app will be monitored.

Unbind the service to undo.

$ cf us myapp scaler
Unbinding app myapp from service scaler in org virtu / space dev as admin...
OK

Youtube

scale-experiment's People

Contributors

killfill avatar

Stargazers

Sun Wuhao avatar Jianhui Z avatar

Watchers

 avatar James Cloos avatar

Forkers

ywang-pivotal

scale-experiment's Issues

How to use it?

I git clone it ,but when I push it there are some problem :

-----> Using go1.3
-----> Running: godep go install -tags cloudfoundry ./...
main_service.go:12:2: cannot find package "go-bro/broker" in any of:
/tmp/cache/go1.3/go/src/pkg/go-bro/broker (from $GOROOT)
/tmp/staged/app/.heroku/g/src/scale-experiment/Godeps/_workspace/src/go-bro/broker (from $GOPATH)
/tmp/staged/app/.heroku/g/src/go-bro/broker
main_service.go:13:2: cannot find package "go-bro/config" in any of:
/tmp/cache/go1.3/go/src/pkg/go-bro/config (from $GOROOT)
/tmp/staged/app/.heroku/g/src/scale-experiment/Godeps/_workspace/src/go-bro/config (from $GOPATH)
/tmp/staged/app/.heroku/g/src/go-bro/config
godep: go exit status 1
-----> Uploading droplet (8.0K)

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.