Skip to content

Optimize Reserved Swarm Initialization #550

Description

@tobi-bams

Problem

When a new reserved swarm is created, it automatically spins up all dependent services (e.g., Boltwall, Neo4j, etc.). However, these services are not needed until the swarm is actually assigned to a user.


Proposed Solution

Introduce a mechanism to keep reserved swarms lightweight until they are assigned:

  1. Grace period check:

    • When a reserved swarm is created, allow it to fully start up.
    • After ~5 minutes (or a configurable window), run a check to identify swarms still in a reserved state.
  2. Dependent service cleanup:

    • For each reserved swarm, stop and remove unnecessary dependent services (e.g., Boltwall, Neo4j).
    • Only the core swarm instance remains running.
  3. Assignment process:

    • When a reserved swarm is assigned to a user, spin up the required dependent services again.
    • This ensures users always get a fully functional swarm without wasted idle services.

Implementation Ideas

  • Add a cron job that:

    • Lists all reserved swarms.
    • Checks their creation timestamps.
    • Stops all dependent services

Metadata

Metadata

Assignees

No one assigned

    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