Introduction Hinting CLIC Performance Conclusion CLIC CLient-Informed Caching for Storage Servers Xin Liu Ashraf Aboulnaga Ken Salem Xuhui Li David R. Cheriton School of Computer Science University of Waterloo February 2009
Introduction Hinting CLIC Performance Conclusion Two-Tier Caching DBMS cache storage server cache p
Introduction Hinting CLIC Performance Conclusion Two-Tier Caching DBMS cache 1. read(p) storage server cache p
Introduction Hinting CLIC Performance Conclusion Two-Tier Caching DBMS cache 1. read(p) storage server cache 2. read(p) p
Introduction Hinting CLIC Performance Conclusion Two-Tier Caching DBMS cache 1. read(p) storage server cache p 2. read(p) 3. fetch p
Introduction Hinting CLIC Performance Conclusion Two-Tier Caching DBMS cache p 1. read(p) 4. fetch storage server cache p 2. read(p) 3. fetch p
Introduction Hinting CLIC Performance Conclusion Two-Tier Caching DBMS cache p Problems: 1. read(p) 4. fetch • cache inclusion storage server cache p 2. read(p) 3. fetch p
Introduction Hinting CLIC Performance Conclusion Two-Tier Caching DBMS cache p Problems: 1. read(p) 4. fetch • cache inclusion • poor temporal locality storage server cache p 2. read(p) 3. fetch p
Introduction Hinting CLIC Performance Conclusion Two-Tier Caching DBMS cache p Problems: 1. read(p) 4. fetch • cache inclusion • poor temporal locality storage server One Solution: cache p • hinting 2. read(p) 3. fetch p
Introduction Hinting CLIC Performance Conclusion Example: Write Hints DBMS cache p write(p) p storage server cache p
Introduction Hinting CLIC Performance Conclusion Example: Write Hints DBMS this is a cache p replacement write write(p) p storage server cache p
Introduction Hinting CLIC Performance Conclusion Example: Write Hints DBMS this is a cache p replacement write write(p) p this is a good storage server candidate for cache caching p
Introduction Hinting CLIC Performance Conclusion Example: Write Hints DBMS this is a cache p replacement write write(p) p this is a good storage server candidate for cache caching p The storage server can use TQ, an ad hoc hint-aware replacement policy, to exploit write hints.
Introduction Hinting CLIC Performance Conclusion Problems with Ad Hoc Hint-Aware Policies narrowness: new hints? multiple hints?
Introduction Hinting CLIC Performance Conclusion Problems with Ad Hoc Hint-Aware Policies narrowness: new hints? multiple hints? brittleness: correct response to hints?
Introduction Hinting CLIC Performance Conclusion Problems with Ad Hoc Hint-Aware Policies narrowness: new hints? multiple hints? brittleness: correct response to hints? single source: multiple hint generators? this is a DBMS DBMS replacement cache cache p q write write(p) this is a p q write(q) replacement write storage server cache should I cache p or q p q ????
Introduction Hinting CLIC Performance Conclusion The CLIC Approach • a hint-aware caching policy for 2nd-tier caches
Introduction Hinting CLIC Performance Conclusion The CLIC Approach • a hint-aware caching policy for 2nd-tier caches • no hard coded response to specific hints
Introduction Hinting CLIC Performance Conclusion The CLIC Approach • a hint-aware caching policy for 2nd-tier caches • no hard coded response to specific hints • instead, learn which hints signal good caching opportunities
Introduction Hinting CLIC Performance Conclusion The CLIC Approach • a hint-aware caching policy for 2nd-tier caches • no hard coded response to specific hints • instead, learn which hints signal good caching opportunities • benefits: • handles multiple hint types • handles new hint types • handles hints from multiple clients by treating each client’s hints as distinct
Introduction Hinting CLIC Performance Conclusion The CLIC Approach • a hint-aware caching policy for 2nd-tier caches • no hard coded response to specific hints • instead, learn which hints signal good caching opportunities • benefits: • handles multiple hint types • handles new hint types • handles hints from multiple clients by treating each client’s hints as distinct CLIC Hints CLIC separates the generation of hints (done by the storage clients) from the interpretation of those hints for caching purposes (done by the storage server).
Introduction Hinting CLIC Performance Conclusion CLIC Illustrated DBMS this is a cache blargh gorp read read(p) I don’t know blargh or gorp storage but previous server cache blargh gorp reads have been good candidates, so I will cache p p
Introduction Hinting CLIC Performance Conclusion Generating Hints • Storage client must be modified to generate one or more types of hints. • Storage clients attach a hint set to each read or write request. A hint set includes one hint of each type generated by the client. • A storage client may choose to generate any types of hints that might be of use to the storage server.
Introduction Hinting CLIC Performance Conclusion Generating Hints • Storage client must be modified to generate one or more types of hints. • Storage clients attach a hint set to each read or write request. A hint set includes one hint of each type generated by the client. • A storage client may choose to generate any types of hints that might be of use to the storage server. Example: Hints from DB2 • buffer pool ID • object ID: identifies a group of related DB objects • object type ID: distinguishes table from index • request type: read, replacement/recovery write • DB2 buffer priority
Introduction Hinting CLIC Performance Conclusion A CLIC-Managed Cache highest priority • each page is associated with the Ha p1 p3 hint set which it was most-recently read or written Hb p7 p5 p4 Hc p2 p9 p6 Hd p8 He lowest priority
Introduction Hinting CLIC Performance Conclusion A CLIC-Managed Cache highest priority • each page is associated with the Ha p1 p3 hint set which it was most-recently read or written Hb p7 p5 p4 • each hint set has a priority Hc p2 p9 p6 Hd p8 He lowest priority
Introduction Hinting CLIC Performance Conclusion A CLIC-Managed Cache highest priority • each page is associated with the Ha p1 p3 hint set which it was most-recently read or written Hb p7 p5 p4 • each hint set has a priority Hc p2 p9 • CLIC evicts pages associated with the lowest-priority hint sets p6 Hd p8 He lowest priority
Introduction Hinting CLIC Performance Conclusion A CLIC-Managed Cache highest priority • each page is associated with the Ha p1 p3 hint set which it was most-recently read or written Hb p7 p5 p4 • each hint set has a priority Hc p2 p9 • CLIC evicts pages associated with the lowest-priority hint sets p6 Hd • CLIC chooses hint set priorities using a simple cost/benefit p8 He analysis lowest priority
Introduction Hinting CLIC Performance Conclusion Cost/Benefit Analysis cache p here?? time (p,H) next request for p read or write request
Introduction Hinting CLIC Performance Conclusion Cost/Benefit Analysis cache p here?? time (p,H) next request for p read or write request is this a read request? • there is a benefit to caching if the next request for p is a read request
Introduction Hinting CLIC Performance Conclusion Cost/Benefit Analysis cache p here?? time (p,H) next request for p read or write request is this a read request? • there is a benefit to caching if the next request for p is a read request • the cost of obtaining this benefit is that p must remain cached until the read request
Introduction Hinting CLIC Performance Conclusion Assigning Priorities to Hint Sets cache p here?? time (p,H) next request for p read or write request is this a read request? • when request ( p , H ) occurs, CLIC cannot know the the cost and benefit of caching p
Introduction Hinting CLIC Performance Conclusion Assigning Priorities to Hint Sets cache p here?? time (p,H) next request for p read or write request is this a read request? • when request ( p , H ) occurs, CLIC cannot know the the cost and benefit of caching p • instead CLIC estimates the cost and benefit of caching p at ( p , H ) based on previous requests with hint set H
Introduction Hinting CLIC Performance Conclusion Assigning Priorities to Hint Sets cache p here?? time (p,H) next request for p read or write request is this a read request? • when request ( p , H ) occurs, CLIC cannot know the the cost and benefit of caching p • instead CLIC estimates the cost and benefit of caching p at ( p , H ) based on previous requests with hint set H • CLIC assigns a priority to each hint set based on the cost and benefit of previous requests with hint set H Read Hit Rate ( H ) Priority ( H ) = Mean Time Until Read Hit ( H )
Introduction Hinting CLIC Performance Conclusion DB2 Hint Analysis Example STOCK table replacement writes ORDERLINE table reads
Recommend
More recommend