Exploiting Gray-Box Knowledge of Buffer Cache Management Nathan C. Burnett, John Bent, Andrea C. Arpaci-Dusseau, Remzi H. Arpaci-Dusseau University of.

Slides:



Advertisements
Similar presentations
Dissemination-based Data Delivery Using Broadcast Disks.
Advertisements

4.4 Page replacement algorithms
The Performance Impact of Kernel Prefetching on Buffer Cache Replacement Algorithms (ACM SIGMETRIC 05 ) ACM International Conference on Measurement & Modeling.
Page-replacement policies On some standard algorithms for the management of resident virtual memory pages.
1 Cache and Caching David Sands CS 147 Spring 08 Dr. Sin-Min Lee.
1 Storage-Aware Caching: Revisiting Caching for Heterogeneous Systems Brian Forney Andrea Arpaci-Dusseau Remzi Arpaci-Dusseau Wisconsin Network Disks University.
1 Storage-Aware Caching: Revisiting Caching for Heterogeneous Storage Systems (Fast’02) Brian Forney Andrea Arpaci-Dusseau Remzi Arpaci-Dusseau Wisconsin.
Buffer management.
Virtual Memory. 2 What is virtual memory? Each process has illusion of large address space –2 32 for 32-bit addressing However, physical memory is much.
Caching and Virtual Memory. Main Points Cache concept – Hardware vs. software caches When caches work and when they don’t – Spatial/temporal locality.
Information and Control in Gray-Box Systems Arpaci-Dusseau and Arpaci-Dusseau SOSP 18, 2001 John Otto Wi06 CS 395/495 Autonomic Computing Systems.
CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University1 Memory Management – 4 Page Replacement Algorithms CS 342 – Operating Systems.
OS Spring ’ 04 Scheduling Operating Systems Spring 2004.
Caching and Demand-Paged Virtual Memory
1 Today I/O Systems Storage. 2 I/O Devices Many different kinds of I/O devices Software that controls them: device drivers.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts, Amherst Operating Systems CMPSCI 377 Lecture.
Cambodia-India Entrepreneurship Development Centre - : :.... :-:-
Introduction to Database Systems 1 The Storage Hierarchy and Magnetic Disks Storage Technology: Topic 1.
CS4432: Database Systems II Data Storage (Better Block Organization) 1.
Virtual Memory.
Caching and Virtual Memory. Main Points Cache concept – Hardware vs. software caches When caches work and when they don’t – Spatial/temporal locality.
Performance Tradeoffs for Static Allocation of Zero-Copy Buffers Pål Halvorsen, Espen Jorde, Karl-André Skevik, Vera Goebel, and Thomas Plagemann Institute.
Interposed Request Routing for Scalable Network Storage Darrell Anderson, Jeff Chase, and Amin Vahdat Department of Computer Science Duke University.
Introduction and Overview Questions answered in this lecture: What is an operating system? How have operating systems evolved? Why study operating systems?
Networked Storage Technologies Douglas Thain University of Wisconsin GriPhyN NSF Project Review January 2003 Chicago.
1 Geiger: Monitoring the Buffer Cache in a Virtual Machine Environment Stephen T. Jones Andrea C. Arpaci-Dusseau Remzi H. Arpaci-Dusseau Department of.
Page Replacement in Real Systems Questions answered in this lecture: How can the LRU page be approximated efficiently? How can users discover the page.
« Performance of Compressed Inverted List Caching in Search Engines » Proceedings of the International World Wide Web Conference Commitee, Beijing 2008)
Amy Apon, Pawel Wolinski, Dennis Reed Greg Amerson, Prathima Gorjala University of Arkansas Commercial Applications of High Performance Computing Massive.
X-RAY: A Non-Invasive Exclusive Caching Mechanism for RAIDs Lakshmi N. Bairavasundaram Muthian Sivathanu Andrea C. Arpaci-Dusseau Remzi H. Arpaci-Dusseau.
Chapter 21 Virtual Memoey: Policies Chien-Chung Shen CIS, UD
CS Operating System & Database Performance Tuning Xiaofang Zhou School of Computing, NUS Office: S URL:
Increasing Web Server Throughput with Network Interface Data Caching October 9, 2002 Hyong-youb Kim, Vijay S. Pai, and Scott Rixner Rice Computer Architecture.
PR SM Laboratory A Parameter Extraction Tool for Windows I/O System Characterization Versailles Saint Quentin University National Scientific research center.
Exploiting Gray-Box Knowledge of Buffer Cache Management Nathan C. Burnett, John Bent, Andrea C. Arpaci-Dusseau, Remzi H. Arpaci-Dusseau University of.
OSes: 3. OS Structs 1 Operating Systems v Objectives –summarise OSes from several perspectives Certificate Program in Software Development CSE-TC and CSIM,
Deconstructing Storage Arrays Timothy E. Denehy, John Bent, Florentina I. Popovici, Andrea C. Arpaci-Dusseau, Remzi H. Arpaci-Dusseau University of Wisconsin,
Chapter 1 Computer Abstractions and Technology. Chapter 1 — Computer Abstractions and Technology — 2 The Computer Revolution Progress in computer technology.
Providing Differentiated Levels of Service in Web Content Hosting Jussara Almeida, etc... First Workshop on Internet Server Performance, 1998 Computer.
Operating Systems (CS 340 D) Princess Nora University Faculty of Computer & Information Systems Computer science Department.
1 Admission Control and Request Scheduling in E-Commerce Web Sites Sameh Elnikety, EPFL Erich Nahum, IBM Watson John Tracey, IBM Watson Willy Zwaenepoel,
Flexibility, Manageability and Performance in a Grid Storage Appliance John Bent, Venkateshwaran Venkataramani, Nick Leroy, Alain Roy, Joseph Stanley,
Storage Research Meets The Grid Remzi Arpaci-Dusseau.
Latency Reduction Techniques for Remote Memory Access in ANEMONE Mark Lewandowski Department of Computer Science Florida State University.
Improving Disk Throughput in Data-Intensive Servers Enrique V. Carrera and Ricardo Bianchini Department of Computer Science Rutgers University.
CPS110: Page replacement Landon Cox. Replacement  Think of physical memory as a cache  What happens on a cache miss?  Page fault  Must decide what.
Operating Systems: Wrap-Up Questions answered in this lecture: What is an Operating System? Why are operating systems so interesting? What techniques can.
Virtual Memory Questions answered in this lecture: How to run process when not enough physical memory? When should a page be moved from disk to memory?
Transforming Policies into Mechanisms with Infokernel Andrea C. Arpaci-Dusseau, Remzi H. Arpaci-Dusseau, Nathan C. Burnett, Timothy E. Denehy, Thomas J.
NeST: Network Storage John Bent, Venkateshwaran V Miron Livny, Andrea Arpaci-Dusseau, Remzi Arpaci-Dusseau.
Operating Systems: Summary INF1060: Introduction to Operating Systems and Data Communication.
Providing Differentiated Levels of Service in Web Content Hosting J ussara Almeida, Mihaela Dabu, Anand Manikutty and Pei Cao First Workshop on Internet.
CS422 Principles of Database Systems Buffer Management Chengyu Sun California State University, Los Angeles.
1 Lecture 16: Data Storage Wednesday, November 6, 2006.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
Taeho Kgil, Trevor Mudge Advanced Computer Architecture Laboratory The University of Michigan Ann Arbor, USA CASES’06.
CS222: Principles of Data Management Lecture #4 Catalogs, Buffer Manager, File Organizations Instructor: Chen Li.
Operating System Overview
Chapter 21 Virtual Memoey: Policies
Lecture 9: Data Storage and IO Models
Distributed Systems CS
Admission Control and Request Scheduling in E-Commerce Web Sites
Database Management Systems (CS 564)
Dept. of Computer Science, Univ. of Rochester
Persistence: hard disk drive
NeST: Network Storage Technologies
Virtual Memory: Working Sets
Lecture 9: Caching and Demand-Paged Virtual Memory
Operating Systems Concepts
Dong Hyun Kang, Changwoo Min, Young Ik Eom
Presentation transcript:

Exploiting Gray-Box Knowledge of Buffer Cache Management Nathan C. Burnett, John Bent, Andrea C. Arpaci-Dusseau, Remzi H. Arpaci-Dusseau University of Wisconsin - Madison Department of Computer Sciences

2 Caching Buffer cache impacts I/O performance –Cache hits much faster than disk reads Buffer Cache Data Blocks OS Without Cache Knowledge: 2 disk reads With Cache Knowledge 1 disk read

3 Knowledge is Power Applications can use knowledge of cache state to improve overall performance –Web Server –Database Management Systems Often no interface for finding cache state –Abstractions hide information

4 Workload + Policy  Contents Cache contents determined by: –Workload –Replacement policy Algorithmic Mirroring –Observe workload –Simulate cache using policy knowledge –Infer cache contents from simulation model

5 Gaining Knowledge Application knows workload –Assume application dominates cache Cache policy is usually hidden –Documentation can be old, vague or incorrect –Source code may not be available How can we discover cache policy?

6 Policy Discovery Fingerprinting: automatic discovery of algorithms or policies (e.g. replacement policy, scheduling algorithm) Dust - Fingerprints buffer cache policies –Correctly identifies many different policies –Requires no kernel modification –Portable across platforms

7 This Talk Dust –Detecting initial access order (e.g. FIFO) –Detecting recency of access (e.g. LRU) –Detecting frequency of access (e.g. LFU) –Distinguishing clock from other policies Fingerprints of Real Systems –NetBSD 1.5, Linux , Linux Exploiting Gray-Box Knowledge –Cache-Aware Web Server Conclusions & Future Work

8 Dust Fingerprints the buffer cache –Determines cache size –Determines cache policy –Determines cache history usage Manipulate cache in controlled way –open/read/seek/close

9 Replacement Policies Cache policies often use –access order –recency –frequency Need access pattern to identify attributes Explore in simulation –Well controlled environment –Variety of policies –Known implementations

10 Dust I.Move cache to known state a.Sets initial access order b.Sets access recency c.Sets frequency II.Cause part of test data to be evicted III.Sample data to determine cache state Read a block and time it Repeat for confidence

11 Setting Initial Access Order Test Region Eviction Region for ( 0  test_region_size/read_size) { read(read_size); }

12 FIFO Priority FIFO gives latter part of file priority Newer Pages Older Pages

13 Detecting FIFO FIFO evicts the first half of test region Out of Cache In Cache

14 Setting Recency Left Pointer Right Pointer Test Region Eviction Region do_sequential_scan(); left = 0; right = test_region_size/2; for ( 0  test_region_size/read_size){ seek(left); read(read_size); seek(right); read(read_size); right+=read_size; left+= read_size; }

15 LRU Priority LRU gives priority to 2 nd and 4 th quarters of test region

16 Detecting LRU LRU evicts 1 st and 3 rd quarters of test region

17 Setting Frequency Left Pointer Right Pointer Test Region Eviction Region do_sequential_scan(); left = 0; right = test_region_size/2; left_count = 1; right_count = 5; for ( 0  test_region_size/read_size) for (0  left_count) seek(left); read(read_size); for (0  right_count) seek(right); read(read_size); right+=read_size; left+= read_size; right_count++; left_count--;

18 LFU Priority LFU gives priority to center of test region

19 Detecting LFU LFU evicts outermost stripes Two stripes partially evicted

20 The Clock Algorithm Used in place of LRU Ref. bit set on reference Ref. bit cleared as hand passes Hand replaces a page with a ref. bit that’s already clear On eviction, hand searches for a clear ref. bit Page Frame Reference bit

21 Detecting Clock Replacement Two pieces of initial state –Hand Position –Reference Bits Hand position is irrelevant – circular queue Dust must control for reference bits –Reference bits affect order of replacement

22 Detecting Clock Replacement Uniform reference bitsRandom reference bits

23 Two fingerprints for Clock Ability to produce both will imply Clock Need a way to selectively set reference bits Dust manipulates reference bits –To set bits, reference page –To clear all bits, cause hand to sweep Details in paper Clock - Reference Bits Matter

24 Dust Summary Determines cache size (needed to control eviction) Differentiates policies based on –access order –recency –frequency Identifies many common policies –FIFO, LRU, LFU, Clock, Segmented FIFO, Random Identifies history-based policies –LRU-2, 2-Queue

25 This Talk Dust –Detecting initial access order (e.g. FIFO) –Detecting recency of access (e.g. LRU) –Detecting frequency of access (e.g. LFU) –Distinguishing clock from other policies Fingerprints of Real Systems –NetBSD 1.5, Linux , Linux Exploiting Gray-Box Knowledge –Cache-Aware Web Server Conclusions & Future Work

26 Fingerprinting Real Systems Issues: –Data is noisy –Policies usually more complex –Buffer Cache/VM Integration Cache size might be changing Platform: –Dual 550 MHz P-III Xeon, 1GB RAM, Ultra2 SCSI 10000RPM Disks

27 NetBSD 1.5 Increased variance due to storage hierarchy FIFOFIFO LRULRU LFULFU

28 NetBSD 1.5 Four distinct regions of eviction/retention FIFOFIFO LRULRU LFULFU

29 NetBSD 1.5 Trying to clear reference bits makes no difference Conclusion: LRU FIFOFIFO LRULRU LFULFU

30 Linux Very noisy but looks like LRU Conclusion: LRU or Clock FIFOFIFO LRULRU LFULFU

31 Linux Clearing Reference bits changes fingerprint Conclusion: Clock FIFOFIFO LRULRU LFULFU

32 Linux Low recency areas are evicted Low frequency areas also evicted Conclusion: LRU with page aging FIFOFIFO LRULRU LFULFU

33 This Talk Dust –Detecting initial access order (e.g. FIFO) –Detecting recency of access (e.g. LRU) –Detecting frequency of access (e.g. LFU) –Distinguishing clock from other policies Fingerprints of Real Systems –NetBSD 1.5, Linux , Linux Exploiting Gray-Box Knowledge –Cache-Aware Web Server Conclusions & Future Work

34 Algorithmic Mirroring Model Cache Contents –Observe inputs to cache (reads) –Use knowledge of cache policy to simulate cache Use model to make application-level decisions

35 NeST NeST - Network Storage Technology Software based storage appliance Supports HTTP, NFS, FTP, GridFTP, Chirp Allows configurable number of requests to be serviced concurrently Scheduling Policy: FIFO

36 Cache-Aware NeST Takes policy & size discovered by Dust Maintains algorithmic mirror of buffer cache –Updates mirror on each request –No double buffering –May not be a perfect mirror Scheduling Policy: In-Cache-First –Reduce latency by approximating SJF –Improve throughput by reducing disk reads

37 Performance Improvement in response time Robust to inaccuracies in cache estimate 144 clients randomly requesting 200, 1MB files Server: P-III Xeon, 128MB Clients: 4 X P-III Xeon, 1GB Gigabit Ethernet Linux

38 Summary Fingerprinting –Discovers OS algorithms and policies Dust –Portable, user-level cache policy fingerprinting –Identifies FIFO, LRU, LFU, Clock, Random, 2Q, LRU-2 –Fingerprinted Linux 2.2 & 2.4, Solaris 2.7, NetBSD 1.5 & HP-UX Algorithmic Mirroring –Keep track of kernel state in user-space –Use this information to improve performance Cache-Aware NeST –Uses mirroring to improved HTTP performance

39 Future Work On-line, adaptive detection of cache policy Policy manipulation Make other applications cache aware –Databases –File servers (ftp, NFS, etc.) Fingerprint other OS components –CPU scheduler –filesystem layout

40 Questions?? Gray-Box Systems – Wisconsin Network Disks – NeST –

41 Solaris 2.7 FIFOFIFO LRULRU LFULFU

42 HP-UX (IPF) Low recency areas are evicted Low frequency areas also evicted Conclusion: LRU with page aging FIFOFIFO LRULRU LFULFU

43 Related Work Gray-Box (Arpaci-Dusseau) –Cache content detector Connection Scheduling (Crovella, et. al.) TBIT (Padhye & Floyd)

44 Clock - Uniform Reference Bits After initial scan, cache state does not change First half of test region is evicted Buffer Cache before test scan File Buffer Cache after test scan, before eviction scan

45 Clock - Random Reference Bits Initial Sequential Scan Test scan does not change cache state Buffer Cache before test scan File Buffer Cache after test scan, before eviction scan

46 Manipulating Reference Bits Setting bits is easy Clear bits by causing hand to do a circuit Buffer Cache after touching all resident data Buffer Cache after an additional small read