Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemBasedRateLimiter ¶
type MemBasedRateLimiter struct {
// contains filtered or unexported fields
}
MemBasedRateLimiter is a rate limiter based on memory usage. While the high memory limit is reached, MayWait() blocks and try to release memory. When the low memory limit is reached, MayWait() blocks once and may try to release memory. The memory limits are defined as soft limits.
`memoryRateLimiter` provides a way to dynamically update the rate at which the memory limit is checked. When the soft limit is reached, we would like to wait and release memory but not block too often. `freeOSMemoryRateLimiter` provides a way to dynamically update the rate at which `FreeOSMemory` is called when the soft limit is reached.
func BuildMemBasedRateLimiter ¶
func BuildMemBasedRateLimiter(cfg model.Reader, telemetry telemetry.Component) (*MemBasedRateLimiter, error)
BuildMemBasedRateLimiter builds a new instance of *MemBasedRateLimiter
func NewMemBasedRateLimiter ¶
func NewMemBasedRateLimiter( telemetry telemetryInterface, memoryUsage memoryUsage, lowSoftLimitRate float64, highSoftLimitRate float64, goGC int, memoryRateLimiter geometricRateLimiterConfig, freeOSMemoryRateLimiter geometricRateLimiterConfig) (*MemBasedRateLimiter, error)
NewMemBasedRateLimiter creates a new instance of MemBasedRateLimiter.
func (*MemBasedRateLimiter) MayWait ¶
func (m *MemBasedRateLimiter) MayWait() error
MayWait waits and tries to release the memory. See MemBasedRateLimiter for more information.