Documentation ¶
Index ¶
- Constants
- func NewNumaMemoryPressureEvictionPlugin(_ *client.GenericClientSet, _ events.EventRecorder, ...) plugin.EvictionPlugin
- func NewRssOveruseEvictionPlugin(_ *client.GenericClientSet, _ events.EventRecorder, ...) plugin.EvictionPlugin
- func NewSystemPressureEvictionPlugin(_ *client.GenericClientSet, _ events.EventRecorder, ...) plugin.EvictionPlugin
- type EvictionHelper
- type NumaMemoryPressurePlugin
- func (n *NumaMemoryPressurePlugin) GetEvictPods(_ context.Context, request *pluginapi.GetEvictPodsRequest) (*pluginapi.GetEvictPodsResponse, error)
- func (n *NumaMemoryPressurePlugin) GetTopEvictionPods(_ context.Context, request *pluginapi.GetTopEvictionPodsRequest) (*pluginapi.GetTopEvictionPodsResponse, error)
- func (n *NumaMemoryPressurePlugin) Name() string
- func (n *NumaMemoryPressurePlugin) Start()
- func (n *NumaMemoryPressurePlugin) ThresholdMet(_ context.Context) (*pluginapi.ThresholdMetResponse, error)
- type RssOveruseEvictionPlugin
- func (r *RssOveruseEvictionPlugin) GetEvictPods(_ context.Context, request *pluginapi.GetEvictPodsRequest) (*pluginapi.GetEvictPodsResponse, error)
- func (r *RssOveruseEvictionPlugin) GetTopEvictionPods(_ context.Context, _ *pluginapi.GetTopEvictionPodsRequest) (*pluginapi.GetTopEvictionPodsResponse, error)
- func (r *RssOveruseEvictionPlugin) Name() string
- func (r *RssOveruseEvictionPlugin) Start()
- func (r *RssOveruseEvictionPlugin) ThresholdMet(_ context.Context) (*pluginapi.ThresholdMetResponse, error)
- type SystemPressureEvictionPlugin
- func (s *SystemPressureEvictionPlugin) GetEvictPods(_ context.Context, request *pluginapi.GetEvictPodsRequest) (*pluginapi.GetEvictPodsResponse, error)
- func (s *SystemPressureEvictionPlugin) GetTopEvictionPods(_ context.Context, request *pluginapi.GetTopEvictionPodsRequest) (*pluginapi.GetTopEvictionPodsResponse, error)
- func (s *SystemPressureEvictionPlugin) Name() string
- func (s *SystemPressureEvictionPlugin) Start()
- func (s *SystemPressureEvictionPlugin) ThresholdMet(_ context.Context) (*pluginapi.ThresholdMetResponse, error)
Constants ¶
const ( EvictionPluginNameNumaMemoryPressure = "numa-memory-pressure-eviction-plugin" EvictionScopeNumaMemory = "NumaMemory" )
const ( EvictionPluginNameRssOveruse = "rss-overuse-eviction-plugin" RssOveruseEvictionReason = "hit rss overuse policy, threshold is %.2f, current pod rss is %.2f, pod memory request is %d" )
const ( EvictionPluginNameSystemMemoryPressure = "system-memory-pressure-eviction-plugin" EvictionScopeSystemMemory = "SystemMemory" )
Variables ¶
This section is empty.
Functions ¶
func NewNumaMemoryPressureEvictionPlugin ¶
func NewNumaMemoryPressureEvictionPlugin(_ *client.GenericClientSet, _ events.EventRecorder, metaServer *metaserver.MetaServer, emitter metrics.MetricEmitter, conf *config.Configuration) plugin.EvictionPlugin
NewNumaMemoryPressureEvictionPlugin returns a new MemoryPressureEvictionPlugin
func NewRssOveruseEvictionPlugin ¶
func NewRssOveruseEvictionPlugin(_ *client.GenericClientSet, _ events.EventRecorder, metaServer *metaserver.MetaServer, emitter metrics.MetricEmitter, conf *config.Configuration) plugin.EvictionPlugin
func NewSystemPressureEvictionPlugin ¶
func NewSystemPressureEvictionPlugin(_ *client.GenericClientSet, _ events.EventRecorder, metaServer *metaserver.MetaServer, emitter metrics.MetricEmitter, conf *config.Configuration) plugin.EvictionPlugin
Types ¶
type EvictionHelper ¶
type EvictionHelper struct {
// contains filtered or unexported fields
}
EvictionHelper is a general tool collection for all memory eviction plugin
func NewEvictionHelper ¶
func NewEvictionHelper(emitter metrics.MetricEmitter, metaServer *metaserver.MetaServer, conf *config.Configuration) *EvictionHelper
type NumaMemoryPressurePlugin ¶
type NumaMemoryPressurePlugin struct { *process.StopControl // contains filtered or unexported fields }
NumaMemoryPressurePlugin implements the EvictionPlugin interface It triggers pod eviction based on the numa node pressure
func (*NumaMemoryPressurePlugin) GetEvictPods ¶
func (n *NumaMemoryPressurePlugin) GetEvictPods(_ context.Context, request *pluginapi.GetEvictPodsRequest) (*pluginapi.GetEvictPodsResponse, error)
func (*NumaMemoryPressurePlugin) GetTopEvictionPods ¶
func (n *NumaMemoryPressurePlugin) GetTopEvictionPods(_ context.Context, request *pluginapi.GetTopEvictionPodsRequest) (*pluginapi.GetTopEvictionPodsResponse, error)
func (*NumaMemoryPressurePlugin) Name ¶
func (n *NumaMemoryPressurePlugin) Name() string
func (*NumaMemoryPressurePlugin) Start ¶ added in v0.3.0
func (n *NumaMemoryPressurePlugin) Start()
func (*NumaMemoryPressurePlugin) ThresholdMet ¶
func (n *NumaMemoryPressurePlugin) ThresholdMet(_ context.Context) (*pluginapi.ThresholdMetResponse, error)
type RssOveruseEvictionPlugin ¶
type RssOveruseEvictionPlugin struct { *process.StopControl // contains filtered or unexported fields }
RssOveruseEvictionPlugin implements the EvictPlugin interface. It triggers pod eviction based on the rss usage ratio. Once a pod use more rss than the specified threshold, this plugin will evict the pod.The threshold is calculated based on pod's memory request. Its main goal is to make sure sufficient memory for page cache in some scenarios in which service use page cache to improve performance.
func (*RssOveruseEvictionPlugin) GetEvictPods ¶
func (r *RssOveruseEvictionPlugin) GetEvictPods(_ context.Context, request *pluginapi.GetEvictPodsRequest) (*pluginapi.GetEvictPodsResponse, error)
func (*RssOveruseEvictionPlugin) GetTopEvictionPods ¶
func (r *RssOveruseEvictionPlugin) GetTopEvictionPods(_ context.Context, _ *pluginapi.GetTopEvictionPodsRequest) (*pluginapi.GetTopEvictionPodsResponse, error)
func (*RssOveruseEvictionPlugin) Name ¶
func (r *RssOveruseEvictionPlugin) Name() string
func (*RssOveruseEvictionPlugin) Start ¶ added in v0.3.0
func (r *RssOveruseEvictionPlugin) Start()
func (*RssOveruseEvictionPlugin) ThresholdMet ¶
func (r *RssOveruseEvictionPlugin) ThresholdMet(_ context.Context) (*pluginapi.ThresholdMetResponse, error)
type SystemPressureEvictionPlugin ¶
type SystemPressureEvictionPlugin struct { *process.StopControl sync.Mutex // contains filtered or unexported fields }
SystemPressureEvictionPlugin implements the EvictPlugin interface. It triggers pod eviction based on the system pressure of memory.
func (*SystemPressureEvictionPlugin) GetEvictPods ¶
func (s *SystemPressureEvictionPlugin) GetEvictPods(_ context.Context, request *pluginapi.GetEvictPodsRequest) (*pluginapi.GetEvictPodsResponse, error)
func (*SystemPressureEvictionPlugin) GetTopEvictionPods ¶
func (s *SystemPressureEvictionPlugin) GetTopEvictionPods(_ context.Context, request *pluginapi.GetTopEvictionPodsRequest) (*pluginapi.GetTopEvictionPodsResponse, error)
func (*SystemPressureEvictionPlugin) Name ¶
func (s *SystemPressureEvictionPlugin) Name() string
func (*SystemPressureEvictionPlugin) Start ¶ added in v0.3.0
func (s *SystemPressureEvictionPlugin) Start()
func (*SystemPressureEvictionPlugin) ThresholdMet ¶
func (s *SystemPressureEvictionPlugin) ThresholdMet(_ context.Context) (*pluginapi.ThresholdMetResponse, error)