Skip to content

Add Memory Limiting Capability to Service #76

@pjanotti

Description

@pjanotti

Memory Limiting

Due to the high variability inherent to telemetry data it is hard to estimate the memory consumption when running the agent or collector. In practice users have to allocate the maximum amount of memory that will be available for each instance. On the steady state the memory consumption is expected to be low but in any case the service needs to gracefully handle when data is not flowing as intended. In this case queues/buffers are expected to fill but should be kept under certain limits to avoid OOM crashes (that cause all data on memory to be lost).

This requires:

  1. Tracking memory usage and having configurable limits;
  2. Capability to suspend data ingress when the limits are about to be reached;

Tracking Memory Usage

There should a periodic check of current memory usage against the desired limits. When the limits are about to be reached/crossed the tracking system needs to be able to notify receivers that they should suspend data ingestion.

Capability to Suspend Ingest

Receivers will in a cooperative fashion check if it is ok to add more data to their pipelines. This is cooperative so they can provide the proper response according to their protocol and if they should exert back pressure or not (this should be a configurable option on each receive).

Implementation Plan

  • Modify receivers interface to support cooperative check if it is ok to
    ingest more data.
  • Modify each receiver implementation on core to properly react when it the
    ingestion check informs that it should not ingest more data. Add proper
    configurations regarding back-pressure.
  • Add memory limiter that can be used to notify receivers that they should
    suspend ingestion.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions