watchdogconfig

package
v2.34.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

+kubebuilder:validation:Optional

Index

Constants

View Source
const PolicyTempDisabled uint64 = math.MaxUint64

PolicyTempDisabled is a marker value for policies to signal that the policy is temporarily disabled. Use it when all hope is lost to turn around from significant memory pressure (such as when above an "extreme" watermark).

Variables

This section is empty.

Functions

This section is empty.

Types

type AdaptivePolicy

type AdaptivePolicy struct {
	PolicyCommon `json:",inline"`

	// Factor sets user-configured limit of available memory
	Factor float64 `json:"factor" validate:"gte=0,lte=1" default:"0.50"`
}

AdaptivePolicy creates a policy that forces GC when the usage surpasses the configured factor of the available memory. This policy calculates next target as usage+(limit-usage)*factor. swagger:model +kubebuilder:object:generate=true

func (*AdaptivePolicy) DeepCopy

func (in *AdaptivePolicy) DeepCopy() *AdaptivePolicy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AdaptivePolicy.

func (*AdaptivePolicy) DeepCopyInto

func (in *AdaptivePolicy) DeepCopyInto(out *AdaptivePolicy)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*AdaptivePolicy) NextThreshold

func (policy *AdaptivePolicy) NextThreshold(total, used uint64) uint64

NextThreshold implements Policy.

type HeapConfig

type HeapConfig struct {
	WatchdogPolicyType `json:",inline"`

	HeapLimit `json:",inline"`
}

HeapConfig holds configuration for heap Watchdog. swagger:model +kubebuilder:object:generate=true

func (*HeapConfig) DeepCopy

func (in *HeapConfig) DeepCopy() *HeapConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HeapConfig.

func (*HeapConfig) DeepCopyInto

func (in *HeapConfig) DeepCopyInto(out *HeapConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type HeapLimit

type HeapLimit struct {
	// Minimum GoGC sets the minimum garbage collection target percentage for heap driven Watchdogs. This setting helps avoid over scheduling.
	MinGoGC int `json:"min_gogc" validate:"gt=0,lte=100" default:"25"`

	// Maximum memory (in bytes) sets limit of process usage. Default = 256MB.
	Limit uint64 `json:"limit" validate:"gt=0" default:"268435456"`
}

HeapLimit holds configuration for Watchdog heap limit. swagger:model +kubebuilder:object:generate=true

func (*HeapLimit) DeepCopy

func (in *HeapLimit) DeepCopy() *HeapLimit

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HeapLimit.

func (*HeapLimit) DeepCopyInto

func (in *HeapLimit) DeepCopyInto(out *HeapLimit)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Policy

type Policy interface {
	// Returns next threshold or PolicyTempDisabled
	NextThreshold(total, used uint64) uint64
}

Policy is an interface for watchdog policies, eg. Watermarks or adaptive.

type PolicyCommon

type PolicyCommon struct {
	// Flag to enable the policy
	Enabled bool `json:"enabled" default:"false"`
	// contains filtered or unexported fields
}

PolicyCommon holds common configuration for Watchdog policies. swagger:model +kubebuilder:object:generate=true

func (*PolicyCommon) DeepCopy

func (in *PolicyCommon) DeepCopy() *PolicyCommon

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicyCommon.

func (*PolicyCommon) DeepCopyInto

func (in *PolicyCommon) DeepCopyInto(out *PolicyCommon)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type WatchdogConfig

type WatchdogConfig struct {
	Job jobs.JobConfig `json:"job"`

	CGroup WatchdogPolicyType `json:"cgroup"`

	System WatchdogPolicyType `json:"system"`

	Heap HeapConfig `json:"heap"`
}

WatchdogConfig holds configuration for Watchdog Policy. For each policy, either watermark or adaptive should be configured. swagger:model +kubebuilder:object:generate=true

func (*WatchdogConfig) DeepCopy

func (in *WatchdogConfig) DeepCopy() *WatchdogConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WatchdogConfig.

func (*WatchdogConfig) DeepCopyInto

func (in *WatchdogConfig) DeepCopyInto(out *WatchdogConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type WatchdogPolicyType

type WatchdogPolicyType struct {
	WatermarksPolicy WatermarksPolicy `json:"watermarks_policy"`

	AdaptivePolicy AdaptivePolicy `json:"adaptive_policy"`
}

WatchdogPolicyType holds configuration Watchdog Policy algorithms. If both algorithms are configured then only watermark algorithm is used. swagger:model WatchdogPolicyType +kubebuilder:object:generate=true

func (*WatchdogPolicyType) DeepCopy

func (in *WatchdogPolicyType) DeepCopy() *WatchdogPolicyType

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WatchdogPolicyType.

func (*WatchdogPolicyType) DeepCopyInto

func (in *WatchdogPolicyType) DeepCopyInto(out *WatchdogPolicyType)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type WatermarksPolicy

type WatermarksPolicy struct {
	// Watermarks are increasing limits on which to trigger GC. Watchdog disarms when the last watermark is surpassed. It's recommended to set an extreme watermark for the last element (for example, 0.99).
	Watermarks []float64 `json:"watermarks,omitempty" validate:"omitempty,dive,gte=0,lte=1" default:"[0.50,0.75,0.80,0.85,0.90,0.95,0.99]"`

	PolicyCommon `json:",inline"`
	// contains filtered or unexported fields
}

WatermarksPolicy creates a Watchdog policy that schedules GC at concrete watermarks. swagger:model +kubebuilder:object:generate=true

func (*WatermarksPolicy) DeepCopy

func (in *WatermarksPolicy) DeepCopy() *WatermarksPolicy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WatermarksPolicy.

func (*WatermarksPolicy) DeepCopyInto

func (in *WatermarksPolicy) DeepCopyInto(out *WatermarksPolicy)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*WatermarksPolicy) NextThreshold

func (policy *WatermarksPolicy) NextThreshold(total, used uint64) uint64

NextThreshold implements Policy.

Jump to

Keyboard shortcuts

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