Updated the BBolt registry backend implementation plan to include Phase 3: Incremental GC Optimization.
Phase 1: BBolt Backend (5-9 days)
- Basic bbolt backend with full-scan GC
- Suitable for registries < 100K entries
- GC time: ~1-2 seconds for 100K entries, ~7-13 seconds for 1M entries
Phase 2: In-Memory Cache (4-5 days)
- Two-layer caching system
- Full-scan GC for both cache and disk
- Performance improvement for hot data
Phase 3: Incremental GC (4-5 days)
- Batch-based incremental scanning
- Cursor tracking across GC cycles
- Adaptive strategy (auto-selects based on registry size)
- Performance: ~0.5 seconds per 50K batch (vs 7-13s for 1M full scan)
- Scalable to 10M+ entries
filebeat.registry:
type: bbolt
bbolt:
disk_ttl: 30d
cache_ttl: 1h
gc_batch_size: 50000 # NEW: Entries per GC cyclegc_incremental.go- Incremental GC implementationgc_adaptive.go- Adaptive GC strategy selector
-
Incremental GC Algorithm
- Cursor-based scanning
- Configurable batch size (default: 50K)
- Wrap-around logic when reaching end
- Full cycle tracking and logging
-
Adaptive Strategy
- Auto-selects GC method based on registry size
- < 100K entries: full scan (simpler, fast enough)
- > 100K entries: incremental scan (scalable)
-
Performance Metrics
- GC duration logging
- Entries scanned/deleted tracking
- Full cycle completion reporting
-
Cache Incremental GC
- Snapshot-based scanning for in-memory cache
- Batch processing of cache entries
- Position tracking
- Previous total: 9-14 days
- New total: 13-19 days
- Phase 3 is optional - can be deferred if registries remain small
Phase 3 addresses scalability concerns for large registries (1M+ entries) while keeping Phase 1 & 2 simple. The incremental GC:
- Reduces GC pause time from 7-13s to ~0.5s per batch
- Enables horizontal scalability
- Provides smooth, predictable performance
- Can be enabled/disabled via configuration
- GC performance analysis section added
- Configuration examples updated
- Sizing guidelines documented
- Success criteria expanded
- Timeline adjusted