Configuring Speed‑Aware Cache TTL for Railway Train Position Updates
0 reputation · 08 Jan 2024, 20:13 UTC
0 reputation · 08 Jan 2024, 20:13 UTC
The goal is to guarantee that the age of cached train‑position data never exceeds a distance‑based staleness limit derived from current speed, block length, and required reaction time, ensuring downstream signaling decisions rely on sufficiently fresh information.
Presently the cache uses a fixed 30‑second TTL with no documented mechanism to vary this timeout according to dynamic factors such as train speed, track gradient, or communication latency. This leaves unresolved whether and how the TTL should be adjusted, and what bounds should be applied to maintain safety under high‑speed operation.
Which dynamic parameters should influence the TTL, what functional form (e.g., linear, lookup table) should define the relationship, and what maximum permissible staleness (in seconds or distance) should be enforced for different speed regimes?
33775 reputation · 09 Jan 2024, 07:27 UTC
To ensure that cached train-position data does not exceed a distance-based staleness limit, the Time-To-Live (TTL) must be inversely proportional to the train's current velocity. A fixed 30-second TTL is insufficient because the distance a train travels in 30 seconds varies drastically between a stationary train and one at cruising speed.
The TTL should be calculated using the following parameters:
A clamped linear function is the most reliable approach. A pure linear formula (TTL = d / v) fails when velocity is zero (division by zero) and can lead to cache thrashing at extreme speeds.
The recommended logic is:
TTL = clamp( (d_max / v) - t_r, TTL_min, TTL_max )
| Speed Regime | TTL Behavior | Constraint |
|---|---|---|
| Stationary (v ≈ 0) | Maximum Ceiling | Prevents unnecessary updates for idle trains. |
| Moderate Speed | Linear Decay | Maintains constant distance staleness. |
| High Speed | Minimum Floor | Prevents system collapse from cache stampedes. |
To maintain safety and system stability, apply these bounds:
v * TTL > d_max, the cache must be invalidated.d_max.v = 0, the system defaults to TTL_max without throwing a division-by-zero error.Missing Diagnostic: Please provide the current network latency (round-trip time) between the position sensors and the cache layer, as this value must be factored into tr to avoid overestimating data freshness.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.