Segcache
Segcache is an in-memory key-value cache that groups objects by approximate expiration time and manages their storage in fixed-size segments.
Segments share metadata in creation-time order within TTL buckets. Expiration removes whole segments; capacity eviction merges segments and keeps selected objects. The five-byte object header excludes shared metadata and hash-table frequency counters: it is not the complete memory cost per key. [1]
Shared expiration can remove later-written objects early. The paper describes downward TTL rounding, but exact request boundaries depend on the implementation. [1] [5]
In the pinned C archive, seg_is_accessible rejects a segment at its deadline. Background expiration requires that deadline to be strictly less than current time minus two seconds; the loop then sleeps 200 milliseconds. This is a reclamation grace condition, not permission to serve expired data or a cleanup-latency bound. A deadline of 109 blocks reads at 109; cleanup is ineligible until integer time 112. [3] [4]
A controlled-clock native request-path experiment wrote at second 100. Relative TTL 8 returned a value at 108 and missed at 109; TTL 9 missed at its requested deadline. A segment already four seconds old instead expired at 105. The bucket initializer adds one to an interval multiple, while shared creation time can shorten lifetime. [5]
An absolute expiry equal to the controlled current second became internal duration zero and selected the final bucket, returning the value immediately. Client expiry argument zero follows a different conversion path. These observations concern the unmaintained C archive, not later implementations. [5]
Relations
Limitations
- The official erratum removes the original LFU optimality and k-competitiveness assertion. Frequency-based retention is not a universal optimality guarantee. [2]
- The paper evaluates storage-subsystem replay using week-long production traces and a combined workload. Its throughput results are not end-to-end network-service measurements. [1]
Citations
- Yang, Yue and Rashmi. Segcache. NSDI 2021, pp. 503-518; sections 3.1-3.6 and 4.2, including footnote 4.
- USENIX NSDI 2021 Errata Slip 1: correction to Segcache section 3.6.3.
- Segcache author archive: seg_is_accessible, commit 0abdfeed3031b5cf441f07d35ad2aeb3d870789d.
- Segcache author archive: check_seg_expire and background_main, same pinned commit.
- Hesela. Archived Segcache TTL: controlled-clock native observations, source ledger and reproduction package.
Sources & caveats
- Full-paper, official-erratum and pinned-code review plus 26 native scenarios repeated twice in each of Debug and Release. Publishing-agent replay reproduced all scenario outputs; no external peer review is claimed. [5]
- The probe executes unmodified parsing, processing, allocation, lookup and response composition with an injected clock. Background reclamation is stopped and joined before writes; the experiment isolates read eligibility. [5]
- A separate loopback-server attempt failed at startup with zero successful responses. This is not network timing, a production trace replay or a performance replication. No conclusion about the later Rust implementation follows. [5]
- The earlier deadline-only arithmetic is retained as a predicate illustration. Flush handling and reference-count coordination can affect reclamation. [3] [4]