Cost-Aware WWW Proxy Caching Algorithms: University of Wisconsin-Madison University of California-Irvine
Cost-Aware WWW Proxy Caching Algorithms: University of Wisconsin-Madison University of California-Irvine
Pei Cao
University of Wisconsin-Madison
Sandy Irani
University of California-Irvine
1e+00 1e+00
Percentage of References
Percentage of Reference
1e-01 1e-01
1e-02 1e-02
1e-03 1e-03
1e-04 1e-04
1e-05 1e-05
2000 4000 6000 8000 10000 2000 4000 6000 8000 10000
time since last access (minutes) time since last access (minutes)
0.8 0.8
0.4 0.4
0.2 0.2
0.0 0.0
1 10 100 1000 1 10 100 1000
group size (clients) group size (clients)
Figure 4: Hit ratio and byte hit ratio as a function of the size of the user group sharing the cache. The x-axis is
in log scale.
L only increases when GreedyDual-Size has exceeded the line where an interval begins or ends. The total
the size of its cache and must evict a document. Since weight of the intervals that cover this point is the sum
the optimal algorithm has already satised the re- of the sizes of the documents which are in the cache
quest, it has the requested document in the cache. when L reaches a value of L . Since the size of the
0
Since the newly requested document does not t in cache is at most scache , the sum of the weights of the
GreedyDual-Size's cache, GreedyDual-Size must have intervals which cover L is at most scache .
0
Table 1: Benets under a cache of innite size for each trace, measured as hit ratio, byte hit ratio, latency
reduction, hop reduction, and weighted-hop reduction.
0.4
Hit Ratio
0.2
0.0
0 5 10 15 20 0 5 10 15 20 0 5 10 15 20 0 5 10 15 20
(a) Hit ratios of LRU, Size, LRV, GD-Size(1) and GD-Size(packets) for each trace group.
0.4
Hit Ratio
0.2
0.0
0 5 10 15 20 0 5 10 15 20 0 5 10 15 20 0 5 10 15 20
(b) A simplified version of (a) showing only the curves for LRU and GD-Size(1).
0.3
Byte Hit Ratio
0.2
0.1
0.0
0 5 10 15 20 0 5 10 15 20 0 5 10 15 20 0 5 10 15 20
Relative Cache Size (%) Relative Cache Size (%) Relative Cache Size (%) Relative Cache Size (%)
Boston University Traces Virginia Tech traces DEC-U1 traces DEC-U2 traces
(c) Byte hit ratios of LRU, Size, LRV, GD-Size(1), and GD-Size(packets) for each trace group.
Figure 6: Hit ratio and byte hit ratio comparison of the algorithms.
duction. GD-Size(latency) and GD-Size(packets) n- simulation. The results also show that the specically
ish the second, with LRU following close behind. designed algorithms achieve their eect. For hop re-
GD-Size(avg latency) performs badly for small cache duction, GD-Size(hops) performs the best, and for
sizes, but performs very well for relatively large cache weighted-hop reduction, GD-Size(weightedhops) per-
sizes. Finally, Hybrid performs the worst. forms the best. This shows that GreedyDual-Size not
Examination of the results shows that the reason only can combine cost concerns nicely with size and
for Hybrid's poor performance is its low hit ratio. locality, but is also very
exible and can accommo-
In the Boston University traces, Hybrid's hit ratio date a variety of performance goals.
is much lower than LRU's for cache sizes 5% of Thus, we recommend GD-Size(hops) as the re-
the total data set sizes, and only slightly higher for placement algorithm for the regulatory role of
larger cache sizes. For all DEC traces, Hybrid's hit proxy caches. If the network cost is proportional
ratio is much lower than LRU's, under all cache sizes. to the number of bytes or packets, then GD-
Hybrid has a low hit ratio because it does not consider Size(weightedhops) is the appropriate algorithm.
how recently a document has been accessed during
replacement.
Since [WA97] reports that Hybrid performs well,
5.5 Summary
our results here seem to suggest that Hybrid's per- Based on the above results, we have the following
formance is perhaps trace-dependent. In our simula- recommendation. If the proxy wants high hit ra-
tion of Hybrid we used the same constants in [WA97], tio or low average latency, GD-Size(1) is the ap-
without tuning them to our traces. Unfortunately we propriate algorithm. If the proxy desires high byte
were not able to obtain the traces used in [WA97]. hit ratio as well, then GD-Size(packets) achieves a
It is a surprise to us that GD-Size(1), which good balance among the dierent goals. If the doc-
does not take latency into account, performs bet- uments have associated network or monetary costs
ter than GD-Size(latency) and GD-Size(avg latency). that do not change over time, or change slowly over
Detailed examination of the traces shows that the time, then GD-Size(hops) or GD-Size(weightedhops)
latency of loading the same document varies signif- is the appropriate algorithm. Finally, in the case of
icantly. In fact, for each of the DEC traces, vari- main memory caching of web documents, GD-Size(1)
ance among latencies of the same document ranges should be used because of its superior performance
from 5% to over 500%, with an average around 71%. under small cache sizes.
Thus, a document that was considered cheap (taking
less time to download) may turn out expensive at the
next miss, while a document that was considered ex- 6 Conclusion
pensive may actually take less time to download. The This paper introduces a simple web cache replace-
best bet for the replacement algorithm, it seems, is ment algorithm: GreedyDual-Size, and shows that it
to maximize hit ratio. outperforms existing replacement algorithms in many
In summary, GD-Size(1) is the best algorithm to performance aspects, including hit ratios, latency re-
reduce average latency. The high variance among duction, and network cost reduction. GreedyDual-
loading latencies for the same document reduces the Size combines locality, cost and size considerations in
eectiveness of latency-conscious algorithms. a unied way without using any weighting function or
parameter. It is simple to implement and accommo-
5.4 Network Costs dates a variety of performance goals. Through trace-
To incorporate network cost considerations, driven simulations, we identify the cost denitions
GD-Size(hops) sets the cost of each document to for GreedyDual-Size that maximize dierent perfor-
the hop value associated with the Web server of mance gains. GreedyDual-Size can also be applied to
the document, and GD-Size(weightedhops) sets the main memory caching of Web documents to further
cost to be hops (2 + file size=536). Figure 7(b) improve performance.
and 7(c) show the hop reduction and weighted-hop The GreedyDual-Size algorithms shown so far can
reduction for LRU, GD-Size(1), GD-Size(hops), and only optimize one performance measure at a time. We
GD-Size(weightedhops). are looking into how to adjust the algorithm when the
The results show that algorithms that consider goal is to optimize more than one performance mea-
network costs do perform better than algorithms that sures (for example, both hit ratio and byte hit ratio).
are oblivious to them. The results here are dierent We also plan to study the integration of hint-based
from the latency results because the network cost as- prefetching with the cache replacement algorithm.
sociated with a document does not change during our Finally, we have shown that if an appropriate
0.20
0.15
Reduced Latency
LRU
Hybrid
GD-Size(1)
0.10
GD-Size(packets)
GD-Size(avg_latency)
GD-Size(latency)
0.05
0.00
0 5 10 15 20 0 5 10 15 20 0 5 10 15 20
0.3
Hop Reduction
0.2
0.1
0.0
0 5 10 15 20 0 5 10 15 20 0 5 10 15 20 0 5 10 15 20
(b) Hop reduction under LRU, GD-Size(1), GD-Size(hops) and GD-Size(weightedhops).
Weighted Hop Reduction
0.2
0.1
0.0
0 5 10 15 20 0 5 10 15 20 0 5 10 15 20 0 5 10 15 20
Relative Cache Size (%) Relative Cache Size (%) Relative Cache Size (%) Relative Cache Size (%)
Boston University Traces Virginia Tech Traces DEC-U1 Traces DEC-U2 traces
(c) Weighted hop reduction under LRU, GD-Size(1), GD-Size(hops) and GD-Size(weightedhops).
Figure 7: Latency, hops, and weighted hops reductions under various algorithms.
network cost can be associated with a document, [Ir97] S. Irani. Page replacement with multi-size
GreedyDual-Size algorithm can be used to adjust pages and applications to web caching. In the
the caching of dierent documents to aect the Proceedings for the 29th Symposium on the The-
Web trac. In other words, if proxy caches use ory of Computing, 1997, pages 701-710.
the GreedyDual-Size algorithm, and they can be in-
formed of the congestion on the network, the caches [LRV97] P. Lorenzetti, L. Rizzo and L. Vi-
can cooperate to reduce the trac over the congested cisano. Replacement Policies for a Proxy Cache.
links. However, how to detect congested path on the http://www.iet.unipi.it/ luigi/research.html.
network and how to assign appropriate cost values for [CBC95] Carlos R. Cunba, Azer Bestavros, Mark E.
the aected documents are topics beyond the scope Crovella Characteristics of WWW Client-based
of this paper, and remain our future work. Traces BU-CS-96-010, Boston University.
[LM96] Paul Leach and Je Mogul. The Hit Metering
Acknowledgement Protocol. Manuscript.
The research is not possible without the support [HT97] IETF The HTTP 1.1 Protocol - Draft.
from people who make their proxy traces available. http://www.ietf.org.
Sandy Irani is supported in part by NSF Grant CCR-
9309456. Our shepherd, Carl Staelin, contributed [ST85] D. Sleator and R. E. Tarjan. Amortized e-
the accumulative percentage graphs and the quartile ciency of list update and paging rules. Communi-
graphs and greatly improved the paper. Finally, the cations of the ACM, 28:202{208, 1985.
anonymous referees provided very helpful comments. [Tufte] Edward Tufte The Visual Display of Quanti-
tative Information. Graphics Printers, Feburary
References 1992.
[ASAWF95] M. Abrams, C.R. Standbridge, [W3C] The Notication Protocol.
G.Abdulla, S. Williams and E.A. Fox. Caching http://www.w3c.org.
Proxies: Limitations and Potentials. WWW-4, [WASAF96] S. Williams, M. Abrams, C.R. Stand-
Boston Conference, December, 1995. bridge, G.Abdulla and E.A. Fox. Removal Poli-
[Bel66] L.A. Belady. A study of replacement algo- cies in Network Caches for World-Wide Web Doc-
rithms for virtual storage computers. IBM Sys- uments. In Proceedings of the ACM Sigcomm96,
tems Journal, 5:78{101, 1966. August, 1996, Stanford University.
[CD73] G. Coman, Jr., Edward and Peter J. Den- [WA97] R. Wooster and M. Abrams. Proxy
ning, Operating Systems Theory, Prentice-Hall, Caching the Estimates Page Load Delays. In
Inc. 1973. the 6th International World Wide Web Con-
ference, April 7-11, 1997, Santa Clara, CA.
[CKPV91] M. Chrobak, H. Karlo, T. H. Payne and http://www6.nttlabs.com/HyperNews/get/ PA-
S. Vishwanathan. New results on server problems. PER250.html.
newblock SIAM Journal on Discrete Mathemat- [WPB] Jussara Almeida and Pei
ics, 4:172{181, 1991. Cao. The Wisconsin Proxy Benchmark (WPB).
[DEC96] Digital Equipment Cooperation, Digital's http://www.cs.wisc.edu/cao/wpb1.0.html.
Web Proxy Traces [You91b] N. Young. The k-server dual and loose com-
ftp://ftp.digital.com/pub/DEC/traces/proxy petitiveness for paging. Algorithmica,June 1994,
/webtraces.html. vol. 11,(no.6):525-41. Rewritten version of \On-
[FKIP96] A. Feldman, A. Karlin, S. Irani, S. Phillips. line caching as cache size varies", in The 2nd An-
Private Communication. nual ACM-SIAM Symposium on Discrete Algo-
rithms, 241-250, 1991.
[Ho97] Hosseini, Saied, Private Communication.
[You97] N. Young. Online le caching. To appear in
[LC97] Chengjie Liu, Pei Cao. Maintaining Strong the Proceedings for the 9th Annual ACM-SIAM
Cache Consistency in the World-Wide Web. In Symposium on Discrete Algorithms, 1998.
Proceedings of the 1997 International Conferences
on Distributed Computing Systems, May, 1997.