You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Stats Synchronization**: Stats are aggregated across all PM2 workers via background interval (every 5 seconds). When you request `/cache/stats`, you receive the most recently synchronized stats, which may be up to 5 seconds stale. This is acceptable for monitoring dashboards and provides fast response times (~2ms) without blocking.
284
+
**Stats Tracking**:
285
+
-**Atomic counters** (sets, evictions, invalidations): Updated immediately in cluster cache to prevent race conditions
286
+
-**Local counters** (hits, misses): Tracked locally per worker, synced to cluster cache every 5 seconds for performance
287
+
-**Aggregation**: Stats endpoint aggregates from all workers, accurate within 5 seconds for hits/misses
Copy file name to clipboardExpand all lines: cache/docs/SHORT.md
+2-4Lines changed: 2 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -93,7 +93,7 @@ Returns aggregated stats from all PM2 workers:
93
93
}
94
94
```
95
95
96
-
**Note**: Stats synchronized via background interval (every 5 seconds). May be up to 5 seconds stale.
96
+
**Stats Accuracy**: Critical counters (sets, evictions, invalidations) use atomic updates for accuracy. Hit/miss counters are synced every 5 seconds for performance.
97
97
98
98
### Clear Cache
99
99
```
@@ -135,9 +135,7 @@ The cache is completely transparent:
135
135
- Cache entries replicated across all worker instances
136
136
- Consistent cache hits regardless of which worker handles request
137
137
- Automatic synchronization via PM2's inter-process communication
138
-
-**Stats Synchronization**: Background interval syncs stats every 5 seconds
139
-
- Stats may be up to 5 seconds stale (acceptable for monitoring)
140
-
- Fast response time (<10ms) for `/cache/stats` endpoint
138
+
-**Stats Tracking**: Atomic counters for sets/evictions/invalidations (race-condition free), local counters for hits/misses (synced every 5 seconds)
141
139
- Version chains properly handled for RERUM's object versioning model
0 commit comments