arXiv:2610.21035cs.PFOct 2026

Manuscript Offprint

arXiv:2610.21035

Caching Policies based on Object Sizes

Ridwanul Hasan Tanvir, George Kesidis

Abstract

We evaluate eviction policies that consider the lengths of the objects being cached for different cache sizes (cost) and different workloads. Workloads include the Independent Reference Model and real-world production traces. In particular, hybrid policies are considered for segmented caches. A working-set approximation is developed for SIEVE as well as its length-aware extension.

Keywords: cache replacement, variable-length objects, size-aware caching, SIEVE, working-set approximation

1 Introduction

Cache replacement is often described as choosing which resident object to evict. For variable-length objects, a caching policy also decides how much byte capacity remains for other objects. Admitting one large object may require evicting hundreds of smaller objects, each of which may be very useful for serving requests in the near future. This setting is common in web caches where objects may range from small metadata records to videos, images, and software artifacts [33,7][33, 7].

The variation in object size is not confined to one cache or one workload. Studies of large-scale Content Distribution Networks (CDNs) and in-memory caches report substantial diversity in both object sizes and access patterns [10,44,7][10, 44, 7]. This matters because replacement policies operate under a byte constraint even when their state is organized around objects. AdaptSize, for example, showed that size-aware admission can substantially change the object hit rate of a CDN cache [10][10], while the LHD policy explicitly accounts for the expected number of hits relative to the space consumed by an object [5][5]. In both systems, object size directly affects which objects the cache should keep.

Consider a cache that serves small API responses, thumbnails, HTML fragments, small images, videos, and software images from the same byte budget. In one production trace we consider, the median object is tens of kilobytes (kB), while the largest object is gigabytes (GB). A single 2GB object can occupy the space of roughly fifty thousand 40kB objects. If a size-oblivious policy admits and protects that large object after one reference, it may evict many small objects that would have served later requests, i.e., those evictions become backend cache misses. The cache may still serve nearly the same byte volume, but it serves fewer requests. The size-aware policies in this paper are designed to avoid this outcome: they retain many small reusable objects unless a large object has shown stronger evidence of current reuse.

The value of size awareness is workload dependent. It is most useful when the objects competing for cache space are both popular and heterogeneous in size, and when their aggregate footprint is larger than the cache budget. If the currently popular objects all fit in the cache, or if the popular objects have nearly equal sizes, a size-oblivious policy loses little by ignoring size. The difficult case is the “middle” one: popular objects overlap in time, compete for the same bytes, and vary enough in size that protecting one large object can displace many smaller objects with comparable current-reuse evidence.

There is, however, no universal rule that smaller objects should receive higher priority. The appropriate treatment of size depends on what the cache is intended to optimize. A request-oriented cache may benefit from retaining more objects that are likely to be requested again, whereas a bandwidth-oriented cache may place greater value on retaining large objects. A particular application using a cache may also attach different costs or importance to different objects. Thus, size is a signal used by the replacement policy; it does not by itself define the objective. In this paper we evaluate the policies from the cache's point of view using conventional object and byte hit rates, rather than assuming an application-specific weighting of objects. This said, we consider different cases of cache capacities as a signal for the cost of the cache, noting that cache users may have Service-Level Objectives (SLOs, in terms of hit rates) which they trade off with capacity-dependent cost as may be specified in a Service-Level Agreement (SLA) of the cache.

An operator can state the design goal in several ways. One objective is to minimize cache capacity while meeting a target hit rate: min⁡B\min B subject to H≥H∗H \geq H^*. Another possible objective fixes the available byte budget and asks for the highest hit rate: max⁡H\max H subject to B≤B∗B \leq B^*. A third possible objective combines performance and resource cost directly: max⁡H−λB\max H - \lambda B, where λ>0\lambda > 0 is the operator's price for resident capacity. Generally non-convex utility formulations of these kinds have been used for cache design and cache policies [16, 32]. The symbol HH can denote object hit rate, byte hit rate, or an application-defined utility-weighted hit rate. Our mechanisms instantiate the object-hit-oriented choice: all other reuse evidence being equal, a shorter object receives more retention priority because the same byte budget can hold more such objects. A different deployment could reverse or reshape this preference. For example, a cache for large media objects, software images, or costly-to-restore data may prefer to protect larger objects under the same framework.

This paper focuses on object hit rate. Object hit rate measures the fraction of requests served from cache, and it is the natural metric when backend request load is the bottleneck. Byte hit rate is also important, but it measures a different objective. A cache that keeps many small popular objects can serve many more requests while moving about the same number of bytes. We therefore optimize for object hit rate and check byte hit rate separately. We also report policy computational overhead, since replacement logic consumes CPU and metadata bandwidth and can limit cache throughput [18, 35], even though its cost may be partly hidden by (pipelined with) the I/O overhead needed to fetch or move large objects.

Prior size-aware designs intervene at different points in cache management. AdaptSize uses object size at admission time and adapts the admission rule as the workload changes [10]. LHD instead estimates the expected hits obtained per unit of cache space and uses that estimate to guide replacement [5]. Both approaches demonstrate that size can be useful when the objective is request hit rate, but they introduce mechanisms specifically designed for size-aware admission or ranking. We ask a narrower question: how much of this benefit can be obtained by adding a small, causal, size-dependent decision to replacement policies that already have their own notions of recency, reuse, admission, and promotion?

We start with SIEVE, a FIFO-like policy that uses one visited bit and an eviction hand [47]. We then apply the same size signal inside three common blended families: 2Q, ARC, and S3-FIFO. In every case, the policy sees only past requests and current object sizes. It does not use future reuse, offline labels, or an oracle.

The evaluation follows the same point of view. Rather than selecting one cache size and declaring a winner, we compare policies across byte budgets and ask how object hit rate changes with the amount of cache memory allocated. This exposes the performance–capacity tradeoff that a cache operator faces when provisioning memory [38]. The synthetic traces then isolate one part of that tradeoff by holding the request process fixed while increasing the coefficient of variation of object sizes.

SIEVE is a natural starting point because its replacement state is small. A hit records reuse by setting a visited bit, while the ordering of resident objects is left unchanged until the eviction hand examines them [47]. The same work also showed that SIEVE can serve as a replacement primitive inside policies such as 2Q and ARC, rather than only as a standalone cache policy. Canonical SIEVE, however, gives the same replacement state to objects of different sizes. This leaves a direct question for variable-length caches: whether size can be incorporated without giving up the simple state and deferred eviction decisions that make SIEVE attractive.

A deployed cache should not need a new cache architecture to obtain a basic size signal. We therefore keep the mechanisms close to their parent policies, which also lets us measure the effect of the size signal directly.

A second question is whether the resulting behavior admits a useful analytical description. Characteristic-time and working-set approximations have provided a tractable way to reason about cache occupancy and hit probability for policies such as LRU under the Independent Reference Model (IRM) [13, 20, 28, 22, 21, 19]. SIEVE does not maintain an LRU stack: objects remain in insertion order, and eviction is determined by successive examinations of the hand. In particular, the first examination after admission is different from subsequent examinations of an object that has already survived one examination. We therefore examine whether these two stages can be represented by separate characteristic times, and whether the resulting approximation can be adapted from an object-count constraint to the byte-capacity constraint of a variable-length cache.

This paper makes the following contributions.

  • We describe two new causal size-aware variants to SIEVE (Section 2.4). Mean-Threshold grants extra protection below the running mean object size, while Dual-Threshold separates small, medium, and large objects using the running mean. On the production traces, Dual-Threshold increases object hit rate by up to 27.7% over canonical SIEVE.

  • We evaluate size-aware policies across production and synthetic traces, including LRU-MIN (reported as LRU 1^{1}), Dual-Threshold SIEVE (reported as SIEVE 1^{1}), and new size-aware segmented versions of 2Q, ARC, and S3-FIFO (Section 2.7). The hybridized SIEVE-based policies give the best object hit rate most often: 2Q-SIEVE 1^{1} on the META traces and ARC-SIEVE 1^{1} on the synthetic traces.

  • We compare cache-eviction policies in terms of hit rate versus cache-memory size rather than at a single fixed cache size. This is the performance-cost tradeoff seen from a user's point of view.

  • We develop a new working-set approximation for SIEVE under the IRM (Section 6 and Appendix E). The model uses two examination times and handles variable-length objects by replacing the unit-capacity equation with a byte-weighted one.

This paper is organized as follows. Section 2 introduces the cache model, size-aware replacement mechanisms, and the policies evaluated in the paper. Section 3 describes the traces, metrics, and experimental setup. Sections 4–5 present the empirical results, Section 6 develops the working-set approximation, and Sections 7 and 8 discuss implications and conclude.

References (40)