1 / 29

Competitive analysis of the LRFU paging algorithm

Competitive analysis of the LRFU paging algorithm. Edith Cohen -- AT&T Haim Kaplan -- Tel Aviv Univ . Uri Zwick -- Tel Aviv Univ. How do you decide which page to evict ?. Online paging problem. Get requests to pages. You have a cache with k slots. Upon a request for page p.

apu
Download Presentation

Competitive analysis of the LRFU paging algorithm

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Competitive analysis of the LRFU paging algorithm Edith Cohen -- AT&T Haim Kaplan -- Tel Aviv Univ. Uri Zwick -- Tel Aviv Univ.

  2. How do you decide which page to evict ? Online paging problem Get requests to pages You have a cache with k slots Upon a request for page p if p  cache you get a hit. Otherwise you have to put p into the cache and you get a miss Want to minimize the miss rate

  3. LRU and LRU LRU = Evicts the Least Recently Used page

  4. LFU = Evicts the Least Frequently Used page LRU and LRU LRU = Evicts the Least Recently Used page

  5. LRU and LRU LRU = Evicts the Least Recently Used page LFU = Evicts the Least Frequently Used page

  6. Competitive analysis miss rate (A) On the worst-case sequence competitive ratio (A) = miss rate (OPT) competitive ratio(LRU) = k competitive ratio(LFU) = unbounded Both are good in practice. Borodin, El Yaniv : Is there a natural algorithm that has a finite competitive ration which is less than k ?

  7. LRFU (Lee,Choi,Kim,Noh,Min,Cho,Kim Sigmetrics’99) Each page p in the cache has a value v(p) Upon a request for a page q we do the following (a) For every p  cache v(p)  v(p) (b) If q cache we evict the page with smallest value. We put q in with v(q) = 1. If q cache v(q) = 1 + v(q).  =1 ==> LRFU1 = LFU

  8. 1 2 LRFU 1 2 Each page p in the cache has a value v(p) Upon a request for a page q we do the following (a) For every p  cache v(p)  v(p) (b) If q cache we evict the page with smallest value. We put q in with v(q) = 1. If q cache v(q) = 1 + v(q). By induction v(q) < 2 and older pages have values smaller than 1 (ordered by most recent request). Therefore LRFU = LRU 1 2

  9. 1 LRFU 3 4

  10. 1 LRFU 3 4

  11. LRFU 3 4 7 4

  12. LRFU 3 4 7 4

  13. 1 LRFU 3 4 21 16

  14. 1 LRFU 3 4 21 16

  15. LRFU 3 4 3 4 63 64

  16. LRFU 3 4 1 3 4 63 64

  17. LRFU 3 4 1 3 4 63 64

  18. LRFU 3 4 3 4 3 3 * 4 4 3 63 * 4 64

  19. LRFU 3 4 3 4 1 3 63 * 4 64

  20. LRFU 3 4 3 4 1 3 63 * 4 64

  21. LRFU 3 4 9 16 3 4 1

  22. 1 1 1-  1-  Observations If we request the page over and over again its value approaches 1 +  + 2 + 3 + 4 + = If a page has not been requested within the last j requests than its value is smaller than j + (j+1) + (j+3) = j

  23. > -L 1 1 1 1 1-  1-  1-  1-  -(L+1)  Our result Let L be an integer such that L > 1 But, L+1  1 Theorem :The competitive ratio of LRFU is k + L .

  24. Proof (upper bound). Partition the sequence into phases. ……... OPT gets at least one miss in each phase

  25. 1 1-  Proof (upper bound). Consider the cache after request L+1 (in a phase), for each p  cache not yet requested in the phase L+1 v(p) <  1 When there are no more pages unrequested since the beginning of the page, phase ends So each page that gets into the cache after request L stays there until the end of the phase. ==> at most L + k misses in a phase

  26. Proof (lower bound). We show a sequence such that LRFU misses k+L times for every miss of OPT

  27. 1 1-  Proof (lower bound). Idea: Assume there are k+1 pages Pumps up v(p), by requesting it over and over again until -(L+1) -L < v(p) < and for every other page pi, v(pi) < 1. Now request the page not in LRFU’s cache, (OPT evicts p), and keep requesting the page not in LRFU’s cache. The first L such requests p still has the largest value, then p becomes the second largest, etc, until it gets evicted by LRFU. Repeat this over and over again….

  28. Proof (lower bound). LRFU’s cache: p, p2,p3,…..pk p, pk+1 p2,p3,….. OPT evicts p p, pk pk+1 p2,p3,….. p, pk-L+2…... pk pk+1 p2,p3,….. pk-L+1 p, pk-L+2…... pk pk+1 p2,p3,….. In k-1 more steps p is out

  29. Open problems LRFU proves practically useful, LCKNMCK 99. For which sequences LRFU performs better than LRU and LFU ?

More Related