Giter Site home page Giter Site logo

aditya8293 / oci-autoscale Goto Github PK

View Code? Open in Web Editor NEW

This project forked from anykeynl/oci-autoscale

0.0 1.0 0.0 33 KB

Automatic Scaling for OCI BM Database Cloud Service (Schedule based)

License: GNU General Public License v3.0

Python 100.00%

oci-autoscale's Introduction

OCI-AutoScale

There are 3 main Autoscaling Scripts here.

Autoscale; this script is designed to run inside the Baremetal instances running the Oracle Database Cloud Service.

Autoscale_AWD_ATP; this script is designed to scall ALL ADW and ATP services that have a valid Schedule tag. You need to run this script somewere that has internet access so it can talk to the Oracle Cloud API. This can be in the cloud or on-premise.

AutoOnOff_compute; this script is designed to automatically power on / off compute instances based on the hour of the day. You need to run this script somewere that has internet access so it can talk to the Oracle Cloud API. This can be in the cloud or on-premise.

Auto Start and Stop

As the ATP and ADW services also support turning an instance on and off (and reducing cost), the AWD_ATP script supports this now. If you specify and 0 (zero) for the hour, it will stop the service. If the services is stopped and the hour requires more then 0 cpu cores, it will automatically start the instance and then scale it to the appropriate size.

As the starting takes some time, I have updated the ADW_ATP script with support for multi threading, so that all scaling actions happen at the same time, and not sequencially.

How to use

Using pre-defined tags, you can schedule automatic scale up and down event.

Created a Tag Namespace called "Schedule" In that namespace create the following Tag Key Definitions:

  • AnyDay
  • WeekDay
  • Weekend
  • Monday
  • Tuesday
  • Wednesday
  • Thursday
  • Friday
  • Saturday
  • Sunday

After that you can add the takes to any database instance you want to Autoscale based on a schedule. The tag should contain 24 numbers, sperated by commas. Each number represents the amount of CPUs for that specific hour.

Running the Scripts

The script can be run without a parameter or with the parameter "up/down" or "on/off". If the "up/on" parameter is specified the script will only execute scaling Up / Power on actions. If "down/off" is specified, it will only do scaling Down and power off actions. If nothing is specified, the script will do BOTH scaling and power actions.

I would recommend you run scaling down actions 1 or 2 minutes before the end of the hour and run scaling up actions just after the hour.

Scaling Example

More information

Please check www.oc-blog.com

Demo video: https://youtu.be/5jsGgfClPAM

oci-autoscale's People

Contributors

anykeynl avatar

Watchers

James Cloos 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.