Skip to content

Systemd boot load shaping #7705

@DavidePrincipi

Description

@DavidePrincipi

Introduce a systemd generator that dynamically creates dependency and rate-limiting logic for lingered application sessions user@UID.service at boot.

Ensure applications (which run as lingered users) start in controlled tiers rather than all at once.

This feature aims to smooth system load during cluster boot, preventing CPU and I/O congestion from simultaneous application startups while keeping the process deterministic and fully integrated with systemd.

Proposed solution

  • Provide a configuration file /etc/linger-shaper.tiers to map applications to their tier, with unlisted apps defaulting to tier-2.
  • Implement the boot logic entirely through systemd drop-ins and helper units, without long-running daemons.
  • Allow future extension for tier auto-assignment from NS8 application metadata.

Support three priority levels:

  • core apps — start first, sequentially.
  • tier-1 apps — start next, in parallel but limited to nproc/2 concurrent sessions.
  • tier-2 apps — start last, with the same parallel limit.

Alternative solution

  • Generate Systemd drop-ins for user@UID.service units. Add After= dependency to shape the load.
  • After= Dependency is generated to start at most nproc/2 chain of units at the same time.
  • Make user@ unit startup blocking, until the user session is fully up.

Additional context

Boot time load recorded by netdata:

Image

See also

Metadata

Metadata

Assignees

No one assigned

    Labels

    verifiedAll test cases were verified successfully

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions