Per-actor passivation
Per-actor passivation is configured per actor at spawn. The passivation manager tracks each actor and stops it when its strategy triggers. Only actors with a passivation strategy (other thanLongLivedStrategy) are tracked.
Strategies
Usage
WithLongLived() to opt out:
When to use
- Grains and virtual actors (default for many grains)
- Actors with large per-instance state
- High churn of short-lived entities
When to avoid
- Long-lived services that must stay up
- Actors that handle infrequent but critical messages
System eviction
System eviction is a node-wide mechanism that limits the total number of active actors. When the count exceeds the configured limit, the framework passivates actors according to an eviction policy (LRU, LFU, or MRU). This is independent of per-actor passivation—system eviction can stop any user actor, including those withLongLivedStrategy.
Eviction policies
Configuration
Behavior
- The eviction loop runs at the configured interval.
- When
NumActors() > limit, actors are selected by policy and passivated viaShutdown. - The number of actors to evict is the greater of: (total − limit) and (percentage × total / 100).
- System actors (reserved names) are excluded. Only user actors are eligible for eviction.
When to use
- Memory or resource constraints on a node
- Bounding actor count regardless of per-actor strategy
- Coarse-grained capacity management