scaling

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 12, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

README

Scaling actuators

This directory contains the actuators for horizontal and vertical scaling of cloud-native applications. Both actuators enable control of latency related objectives for now.

Horizontal scaling

Horizontal scaling is realized through two actions:

  1. scale_out which can set the number of replicas for a Deployment/ReplicaSet, and
  2. rm_pod which can remove PODs from Deployment/ReplicaSets.

Vertical scaling

Vertical scaling is supported for cpu resources.

If proactive planning is enabled (by providing a non-zero value for the maximum proactive CPU property) in the configuration, this actuator will aim to rightsize the resource allocations. If a given workload resource has no resource requests or limits defined and the desired SLOs are not fulfilled, the actuator will try to determine the most efficient settings. If resource requests and limits are defined, and the SLOs are not fulfilled, the proactive planning will also be active. If the targeted SLOs are reached, the proactive scaling will stop.

Once a model is available in the database - which described the most efficient resource allocations - the actuator will set the resources requests/limits for the PODs.

For now the actuator will tune the resource allocation for the last container in a POD.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CPUScaleActuator added in v0.2.0

type CPUScaleActuator struct {
	// contains filtered or unexported fields
}

CPUScaleActuator is an actuator supporting the resource scaling.

func NewCPUScaleActuator added in v0.2.0

func NewCPUScaleActuator(apps kubernetes.Interface, tracer controller.Tracer, cfg CPUScaleConfig) *CPUScaleActuator

NewCPUScaleActuator initializes a new actuator.

func (CPUScaleActuator) Effect added in v0.2.0

func (cs CPUScaleActuator) Effect(state *common.State, profiles map[string]common.Profile)

func (CPUScaleActuator) Group added in v0.2.0

func (cs CPUScaleActuator) Group() string

func (CPUScaleActuator) Name added in v0.2.0

func (cs CPUScaleActuator) Name() string

func (CPUScaleActuator) NextState added in v0.2.0

func (cs CPUScaleActuator) NextState(state *common.State, goal *common.State,
	profiles map[string]common.Profile) ([]common.State, []float64, []planner.Action)

func (CPUScaleActuator) Perform added in v0.2.0

func (cs CPUScaleActuator) Perform(state *common.State, plan []planner.Action)

type CPUScaleConfig added in v0.2.0

type CPUScaleConfig struct {
	PythonInterpreter          string  `json:"interpreter"`
	Script                     string  `json:"analytics_script"`
	CPUMax                     int64   `json:"cpu_max"`
	CPURounding                int64   `json:"cpu_rounding"`
	CPUSafeGuardFactor         float64 `json:"cpu_safeguard_factor"`
	MaxProActiveCPU            int64   `json:"max_proactive_cpu"`
	ProActiveLatencyPercentage float64 `json:"proactive_latency_percentage"`
	Port                       int     `json:"port"`
	Endpoint                   string  `json:"endpoint"`
	MongoEndpoint              string  `json:"mongo_endpoint"`
	LookBack                   int     `json:"look_back"`
	PluginManagerEndpoint      string  `json:"plugin_manager_endpoint"`
	PluginManagerPort          int     `json:"plugin_manager_port"`
}

CPUScaleConfig describes the configuration for this actuator. TODO: need to validate the new parameters such as MinCore, MaxCore, CPUIncrement, and MaxProActiveCPU

type CPUScaleEffect added in v0.2.0

type CPUScaleEffect struct {
	// Never ever think about making these non-public! Needed for marshalling this struct.
	LatencyRange     [2]float64
	CPURange         [2]float64
	Popt             [3]float64
	TrainingFeatures [1]string
	TargetFeature    string
	Image            string
}

CPUScaleEffect describes the data that is stored in the knowledge base.

type RmPodActuator

type RmPodActuator struct {
	// contains filtered or unexported fields
}

RmPodActuator is an actuator that can remove particular PODs.

func NewRmPodActuator

func NewRmPodActuator(core kubernetes.Interface, tracer controller.Tracer, cfg RmPodConfig) *RmPodActuator

NewRmPodActuator initializes a new actuator.

func (RmPodActuator) Effect

func (rm RmPodActuator) Effect(_ *common.State, _ map[string]common.Profile)

func (RmPodActuator) Group

func (rm RmPodActuator) Group() string

func (RmPodActuator) Name

func (rm RmPodActuator) Name() string

func (RmPodActuator) NextState

func (rm RmPodActuator) NextState(state *common.State, goal *common.State, profiles map[string]common.Profile) ([]common.State, []float64, []planner.Action)

func (RmPodActuator) Perform

func (rm RmPodActuator) Perform(state *common.State, plan []planner.Action)

type RmPodConfig

type RmPodConfig struct {
	LookBack              int    `json:"look_back"`
	MinPods               int    `json:"min_pods"`
	Port                  int    `json:"port"`
	Endpoint              string `json:"endpoint"`
	MongoEndpoint         string `json:"mongo_endpoint"`
	PluginManagerEndpoint string `json:"plugin_manager_endpoint"`
	PluginManagerPort     int    `json:"plugin_manager_port"`
}

RmPodConfig represents the configuration for this actuator.

type ScaleOutActuator

type ScaleOutActuator struct {
	// contains filtered or unexported fields
}

ScaleOutActuator is an actuator supporting horizontal scaling.

func NewScaleOutActuator

func NewScaleOutActuator(apps kubernetes.Interface, tracer controller.Tracer, cfg ScaleOutConfig) *ScaleOutActuator

NewScaleOutActuator initializes a new actuator.

func (ScaleOutActuator) Effect

func (scale ScaleOutActuator) Effect(state *common.State, profiles map[string]common.Profile)

func (ScaleOutActuator) Group

func (scale ScaleOutActuator) Group() string

func (ScaleOutActuator) Name

func (scale ScaleOutActuator) Name() string

func (ScaleOutActuator) NextState

func (scale ScaleOutActuator) NextState(state *common.State, goal *common.State, profiles map[string]common.Profile) ([]common.State, []float64, []planner.Action)

func (ScaleOutActuator) Perform

func (scale ScaleOutActuator) Perform(state *common.State, plan []planner.Action)

type ScaleOutConfig

type ScaleOutConfig struct {
	PythonInterpreter      string  `json:"interpreter"`
	Script                 string  `json:"analytics_script"`
	MaxPods                int     `json:"max_pods"`
	LookBack               int     `json:"look_back"`
	MaxProActiveScaleOut   int     `json:"max_proactive_scale_out"`
	ProActiveLatencyFactor float64 `json:"proactive_latency_factor"`
	Port                   int     `json:"port"`
	Endpoint               string  `json:"endpoint"`
	MongoEndpoint          string  `json:"mongo_endpoint"`
	PluginManagerEndpoint  string  `json:"plugin_manager_endpoint"`
	PluginManagerPort      int     `json:"plugin_manager_port"`
}

ScaleOutConfig describes the configuration for this actuator.

type ScaleOutEffect

type ScaleOutEffect struct {
	// TODO: make private again once refactored.
	// Never ever think about making these non-public! Needed for marshalling this struct.
	ThroughputRange  [2]float64
	ThroughputScale  [2]float64
	ReplicaRange     [2]int
	Popt             [5]float64
	TrainingFeatures [2]string
	TargetFeature    string
	Image            string
}

ScaleOutEffect describes the data that is stored in the knowledge base.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL