Skip to content

A novel technique to minimize the cost of computation on amazon ec2 spot instances through job migration based on spot score - a measure based upon historical spot prices that reflect on the probabilistic tendency of current spot price changes.

Shahryar-sss/Cloud-Cost-Optimization

Repository files navigation

Cost Optimization in AWS Spot Instances

Dataset Source

Data Source
AWS Spot Price History AWS archive
AWS On Demand Pricing AWS On Demand Pricing Page
Demand Data Google Cluster Usage Trace
Machine Configuration Data Google Cloud Machine Types

Dataset format

The above dataset is aggregated into a python dictionary which is of the format

KEY: VM Type

VALUE: LIST ->

  1. MIPS
  2. RAM
  3. Bandwidth
  4. On Demand Price
  5. LIST -> Spot Prices
  6. LIST -> Spot Scores
  7. Category of the VM
  8. LIST -> RAM distribution

Program Flow

Outlined below is a basic overview of the structure of the program.

Execution starts from this file. A datacenter is first created with appropriate characteristics. Then a datacenter broker is created, using the required VM allocation policy and cloudlet allocation policy. A list of hosts is then created and assigned to the datacenter. Finally a list of cloudlets is created and submitted to the broker for execution.

On receiving a list of cloudlets from the Main.py file, the broker chooses a VM from the configuration data available and provisions it in accordance with the cloudlet allocation policy and places the VM into a host according to the VM allocation policy.

This thread constantly monitors the VMs running, and is responsible for the following:

  1. Deprovisioning VM when corrsponding cloudlet has finished execution.
  2. In case of cloudlet migration, deletes the VM freed up and invokes broker to assign a new VM to the migrating cloudlet.

This thread constantly monitors the running cloudlet, and on every clock tick, does the following:

  1. Checks if cloudlet needs to migrate based on RAM utilisation or increase in spot price above the on demand price
    1. Migrates the cloudlet if required
      1. Inserts the end time for the cloudlet-vm combination into a list property of the cloudlet object
      2. Sets the previous allocated VM type of the cloudlet to the current VM type, to avoid possible infinite loops during migration
      3. Sets the migration event to RAM or SPOT_SCORE, depending on the event.
      4. Removes the cloudlet from its assigned VM
    2. This is detected by VmThread.py, which then assigns a new VM according to above description.
  2. If migration is not required, then decrements the length of the cloudlet according to the MIPS of the assigned VM.

The output of the program is printed to the console window and to the appropriate log files inside the log folder.

About

A novel technique to minimize the cost of computation on amazon ec2 spot instances through job migration based on spot score - a measure based upon historical spot prices that reflect on the probabilistic tendency of current spot price changes.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages