Commit 8882014
authored
(feat) Add MemoryCoordinator and IndexRegistry for serverless scaling (#8)
Introduces two new components for serverless deployments:
MemoryCoordinator:
- Adaptive memory budget split between cache (40%) and mmap (60%)
- Automatic rebalancing based on pressure detection
- Workload hints (BulkIngestion, QueryHeavy, MemoryConstrained)
- Environment variable configuration (XTREE_MEMORY_BUDGET)
IndexRegistry:
- Lazy index loading - indexes registered as lightweight metadata
- On-demand loading via get_or_load<Record>()
- LRU-based cold index eviction under memory pressure
- Manifest integration for serverless cold start
- register_from_data_dir() for one-line initialization
Together these enable scaling to 1000+ indexes in memory-constrained
serverless environments (Lambda, Cloud Run) by loading only active
indexes and automatically unloading cold ones.
48 tests added, all passing.
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>1 parent 47c4cde commit 8882014
File tree
10 files changed
+2960
-1
lines changed- core/src/main/cpp
- src
- persistence
- test
10 files changed
+2960
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
608 | 608 | | |
609 | 609 | | |
610 | 610 | | |
| 611 | + | |
| 612 | + | |
611 | 613 | | |
612 | 614 | | |
613 | 615 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
111 | 112 | | |
112 | 113 | | |
113 | 114 | | |
114 | | - | |
| 115 | + | |
115 | 116 | | |
116 | 117 | | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
117 | 125 | | |
118 | 126 | | |
119 | 127 | | |
| |||
1070 | 1078 | | |
1071 | 1079 | | |
1072 | 1080 | | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
1073 | 1084 | | |
1074 | 1085 | | |
1075 | 1086 | | |
| |||
0 commit comments