GithubHelp home page GithubHelp logo

mwconceicao / tiopatinhas Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chaordic/tiopatinhas

0.0 2.0 0.0 62 KB

An AWS Autoscaling companion that saves money by using instances from the Spot Market

Python 100.00%

tiopatinhas's Introduction

tiopatinhas

Overview

tiopatinhas (tp) is a companion for AWS's Auto Scaling. It attaches itself to an Availability Group and adds resources bought in Amazon's Spot market.

As we can lose those instances at any time (due to market conditions), tiopatinhas only allows itself to provide about 50% of the total number of running instances.

Other features include:

  • efficient use of resources. tiopatinhas is aware of Amazon's one-hour billing cycles and has protections against "flapping"
  • crash recovery: in case there is a market crash, tiopatinhas can acquire instances on the regular OnDemand market
  • fail-safe design: tiopatinhas fails "up". If the process crashes, the worse thing that can happen is extra servers being left in the cluster. Amazon's Autoscaling rules are not modified at all and can take over at any time.

Our theory of operations is that even when the system is live, each server is actually about 50% idle so that the system can responde to changes in access patterns. How much you can commit to Spot Instances is correlated to how low you keep your load during normal system operations. Needless to say, you shouldn't use Spot Instances in systems which are not fault tolerant.

Getting Started

Before starting

  1. Make sure the boto python package is installed in your system. If you use debian or ubuntu you can install it by typing: 'sudo pip install boto'.
  2. Make sure your AWS credentials are specified in a boto configuration file (typically ~/.boto). Instruction on how to setup this file can be found here: https://code.google.com/p/boto/wiki/BotoConfig

Configuring tiopatinhas

  • Copy the template conf file (tp.conf.template) to tp/tp.conf so that the script can read it and make the changes according to your needs. Tio patinhas currently supports the following properties:

Mandatory Properties

  • max_price: A map that specifies the maximum bid prices for each type of EC2 instance. TP will use the prices specified in this map to bid for instances of that type in the spot market.
  • max_candidates: The maximum number of instances TP will manage.
  • instance_name: The prefix that will be used by TP to name managed instances.
  • region: The AWS region where the AutoScaling group is located.
  • placement: The AWS availability zone where TP instances will be launched.
  • health_check_path: Server HTTP path that must respond to health checks before the TP instance is attached to the load balancer.
  • lower_cpu: The AutoScaling CPU treshold for scaling down.
  • upper_cpu: The AutoScaling CPU treshold for scaling up.

Advanced properties

  • spot_type The instance type to bid for in the spot market (recommended: the same instance from the ASG)
  • emergency_type The instance type to buy in case of market crash (recommended: the same instance from the ASG)
  • lower_treshold: The amount of measurements below the lower_cpu TP will consider before scaling down. (advanced)
  • lower_treshold: The amount of measurements above the upper_cpu TP will consider before scaling up. (advanced)

Optional properties

Executing tiopatinhas

  • Once the tp/tp.conf file is ready, execute tiopatinhas issuing the following command:
    • python tp.py -g <AutoScalingGroupName> (this command must currently be executed from within the "tp" folder)
  • You must optionally supply options "-v" for verbose mode or "-d" for daemon mode.

tiopatinhas's People

Contributors

gallois avatar mbanton avatar mwconceicao avatar pauloricardomg avatar rafaelzimmermann 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.