Temporal and Spatial Locality A Time and a

  • Slides: 29
Download presentation
Temporal and Spatial Locality: A Time and a Place for Everything Rick Bunt University

Temporal and Spatial Locality: A Time and a Place for Everything Rick Bunt University of Saskatchewan Carey Williamson University of Calgary

Roll the credits … q Roberta Bodnarchuk q Shikharesh Majumdar q Milind Deshpande q

Roll the credits … q Roberta Bodnarchuk q Shikharesh Majumdar q Milind Deshpande q Shane Mc. Donald q Kevin Froese q Jennifer Murphy q Neeraj Gulati q Adeniyi Oke q Sung Hung Ling q Judy Peachey Temporal and Spatial Locality: A Time and a Place for Everything Slide of 29 December 6, 2003

Outline q What is locality q Elements of locality q Types of locality q

Outline q What is locality q Elements of locality q Types of locality q Applications of locality q Changing locality q Concluding remarks Temporal and Spatial Locality: A Time and a Place for Everything Slide of 29 December 6, 2003

What is Locality An empirically observed phenomenon that has substantial intuitive appeal and numerous

What is Locality An empirically observed phenomenon that has substantial intuitive appeal and numerous practical implications q Parachor Curve q “during any interval of execution, a program favors a subset of its pages, and this set of favored pages changes slowly” [Denning 1970] Temporal and Spatial Locality: A Time and a Place for Everything Slide of 29 December 6, 2003

Impact of Locality q Acceptable page fault rates can be achieved even when the

Impact of Locality q Acceptable page fault rates can be achieved even when the memory allocated to a program is much less than that required to store all of its pages q Internet routers can make high speed routing decisions with very modest forwarding caches q Mobile users can work with remotely stored files even though they are located far from the file server Temporal and Spatial Locality: A Time and a Place for Everything Slide of 29 December 6, 2003

Known Aliases q The law of scattering q The principle of least effort q

Known Aliases q The law of scattering q The principle of least effort q The 80 -20 rule q Concentration of productivity q The law of diminishing returns Temporal and Spatial Locality: A Time and a Place for Everything Slide of 29 December 6, 2003

The Underlying Concept q There is a very large population of items, many more

The Underlying Concept q There is a very large population of items, many more than we can manage q There is a small core of relevant items on which we can productively focus our attention q This core will continue to be relevant long enough to justify our attention Temporal and Spatial Locality: A Time and a Place for Everything Slide of 29 December 6, 2003

Locality Through the Ages q Bradford’s Law of Scattering [1934] q Zipf’s Principle of

Locality Through the Ages q Bradford’s Law of Scattering [1934] q Zipf’s Principle of Least Effort [1949] q Many applications before we discovered it Ø Ø population distribution, distribution of wealth, distribution of biological species, article distribution in journals, and word usage in natural language. has been used to plan the location of libraries and other facilities, to model the popularity of television programs, and to order search keys in hashing tables Temporal and Spatial Locality: A Time and a Place for Everything Slide of 29 December 6, 2003

Elements of Locality q. Concentration: [Bunt and Murphy 1984] q. Persistence: [Arlitt and Williamson

Elements of Locality q. Concentration: [Bunt and Murphy 1984] q. Persistence: [Arlitt and Williamson 1997] Temporal and Spatial Locality: A Time and a Place for Everything Slide of 29 December 6, 2003

Types of Locality q Temporal Locality: Ø Clustering in time: items referenced in the

Types of Locality q Temporal Locality: Ø Clustering in time: items referenced in the immediate past have a high probability of being re-referenced in the immediate future q Spatial Locality: Ø Clustering in space: items located physically near an item referenced in the immediate past have a high probability of being re-referenced in the immediate future Temporal and Spatial Locality: A Time and a Place for Everything Slide of 29 December 6, 2003

Visualizing Locality q. The memory map [Hatfield and Gerald 1971] Temporal and Spatial Locality:

Visualizing Locality q. The memory map [Hatfield and Gerald 1971] Temporal and Spatial Locality: A Time and a Place for Everything Slide of 29 December 6, 2003

Visualizing Locality q. Locality curves: An intrinsic measure [Bunt and Murphy 1984] Temporal and

Visualizing Locality q. Locality curves: An intrinsic measure [Bunt and Murphy 1984] Temporal and Spatial Locality: A Time and a Place for Everything Slide of 29 December 6, 2003

Visualizing Locality q. The Zipf Distribution [Oke and Bunt 2002] Temporal and Spatial Locality:

Visualizing Locality q. The Zipf Distribution [Oke and Bunt 2002] Temporal and Spatial Locality: A Time and a Place for Everything Slide of 29 December 6, 2003

Applications of Locality q. Memory management q. File systems q. Networks q. Web applications

Applications of Locality q. Memory management q. File systems q. Networks q. Web applications Temporal and Spatial Locality: A Time and a Place for Everything Slide of 29 December 6, 2003

Applications in Memory Management q Various approaches to memory management address the principles of

Applications in Memory Management q Various approaches to memory management address the principles of locality in different ways: Ø Ø Recency-based replacement policies such as LRU appeal to the presence of temporal locality in a memory reference pattern. Fetch policies that bring in adjacent items along with the item requested appeal to spatial locality. q Hit ratios are high when good choices are made. Temporal and Spatial Locality: A Time and a Place for Everything Slide of 29 December 6, 2003

Program Behaviour q We know how our programs are structured – program behaviour tells

Program Behaviour q We know how our programs are structured – program behaviour tells us how they execute q Considerable interest throughout the 1960’s, 70’s and 80’s Ø Ø Ø in measuring the referencing behaviour of executing programs in developing models of this behaviour in informing the design of approaches to manage resources Temporal and Spatial Locality: A Time and a Place for Everything Slide of 29 December 6, 2003

Applications in File Systems q Some examples: Ø Ø Ø Rodriguez-Rosell [1976] – an

Applications in File Systems q Some examples: Ø Ø Ø Rodriguez-Rosell [1976] – an early empirical study of locality properties in database references Smith [1981] – characterized long-term file reference behaviour with a focus on file migration Williamson and Bunt [1986] – characterized short-term file reference behaviour with a focus on file system management Majumdar and Bunt [1986 ] – evidence of phase behaviour in file reference traces Smith [1978], Kearns and De. Fazio [1983, 1989] and Verkamo [1985] – locality properties in database references Temporal and Spatial Locality: A Time and a Place for Everything Slide of 29 December 6, 2003

Applications to File Caching q Locality properties have been exploited successfully in the development

Applications to File Caching q Locality properties have been exploited successfully in the development of the caching techniques that are common in today’s distributed file systems. q Applications to mobile computing Ø Ø Froese and Bunt [1999] explored the application of temporal locality in the design of optimistic caching techniques to support the file system activities of mobile users Lindsey et al. [2003] reported evidence of spatial locality in the usage patterns on a campus wireless network Temporal and Spatial Locality: A Time and a Place for Everything Slide of 29 December 6, 2003

Applications in Networks q Even on early networks, measurements showed that packet traffic patterns

Applications in Networks q Even on early networks, measurements showed that packet traffic patterns are far from random Ø structural properties in the network packet behaviour reflect the particular applications, protocols, and network technologies being used n n Ø temporal correlations in the timing structure of the packet arrival process spatial correlations in the destinations seen in consecutive (or nearly consecutive) packets on the network These structural characteristics arise from large application-layer messages (such as those that result from file transfers), that require multiple network -layer packets for transport on the network, and from the bidirectional exchanges of data packets and acknowledgement packets typical in reliable data transfer protocols such as TCP Temporal and Spatial Locality: A Time and a Place for Everything Slide of 29 December 6, 2003

Train Spotting q Jain and Routhier [1986] proposed the packet train model for network

Train Spotting q Jain and Routhier [1986] proposed the packet train model for network traffic characterization based on observations of correlated arrivals Ø provided both a descriptive mechanism for understanding network traffic patterns and a generative mechanism for network traffic modelling q A packet train is a sequence of related network packets that traverse the network like train cars behind a steaming locomotive Ø characterized by short (often deterministic) inter-arrival times between the consecutive packets of a train, with slightly longer (and more random) inter-arrival times between trains Temporal and Spatial Locality: A Time and a Place for Everything Slide of 29 December 6, 2003

Locality in Web Traffic [Arlitt and Williamson 1997] Temporal and Spatial Locality: A Time

Locality in Web Traffic [Arlitt and Williamson 1997] Temporal and Spatial Locality: A Time and a Place for Everything Slide of 29 December 6, 2003

Application to Document Caching q Effective caching of Web documents can significantly lower the

Application to Document Caching q Effective caching of Web documents can significantly lower the number of requests processed by a Web server, reduce the packet traffic volume on the Internet backbone, and improve the userperceived Web response time. q Locality is the key to success Ø Ø Temporal locality in Web accesses implies that Web objects accessed in the recent past are likely to be accessed again (perhaps by some other client) in the near future. Spatial locality in Web accesses reflects Web page structure (i. e. , multiple related Web objects) or geographic correlations in the surfing behaviour of Web users. q Caching can be applied at the servers, at the clients, or at proxies Temporal and Spatial Locality: A Time and a Place for Everything Slide of 29 December 6, 2003

Exploiting Locality in Web Requests q Temporal locality Ø To the extent that temporal

Exploiting Locality in Web Requests q Temporal locality Ø To the extent that temporal locality is present, recency-based policies such as LRU can be effective for a Web cache. q Spatial locality Ø Ø Pre-fetching can be successful if spatial locality is present. The persistent connection feature of HTTP exploits the fact that multiple Web objects are often requested consecutively from the same Web server. Spatial locality can also reflect geographic correlations in the surfing behaviours of Web users, and can make geographic caching and content distribution networks effective. Temporal and Spatial Locality: A Time and a Place for Everything Slide of 29 December 6, 2003

Changing Locality Characteristics q. Intentionally: Program restructuring q. Inadvertently: Filtering locality Temporal and Spatial

Changing Locality Characteristics q. Intentionally: Program restructuring q. Inadvertently: Filtering locality Temporal and Spatial Locality: A Time and a Place for Everything Slide of 29 December 6, 2003

Program Restructuring q The basic premise Ø improving the locality of a program will

Program Restructuring q The basic premise Ø improving the locality of a program will improve its performance q A variety of methods were proposed to do this Ø Ø (Replacement) strategy-based methods Strategy-independent methods q The basic idea Ø Ø divide the program’s address space into small blocks cluster the blocks onto pages according to the dynamic reference characteristics (via restructuring graph). Temporal and Spatial Locality: A Time and a Place for Everything Slide of 29 December 6, 2003

Effects of Restructuring improves locality: [Bunt and Murphy 1984] Restructuring improves performance: [Peachey, Bunt

Effects of Restructuring improves locality: [Bunt and Murphy 1984] Restructuring improves performance: [Peachey, Bunt and Colbourn 1985] Temporal and Spatial Locality: A Time and a Place for Everything Slide of 29 December 6, 2003

Damaging Locality q The locality characteristics of an arriving request stream can be damaged

Damaging Locality q The locality characteristics of an arriving request stream can be damaged in two ways: Ø Ø The interleaving of independent request streams aggregration effect) The removal of “hits” by upstream caches (the filtering effect) (the q This presents problems for traditional approaches to cache management Temporal and Spatial Locality: A Time and a Place for Everything Slide of 29 December 6, 2003

The Cache Filter Effect Temporal and Spatial Locality: A Time and a Place for

The Cache Filter Effect Temporal and Spatial Locality: A Time and a Place for Everything Slide of 29 [Froese and Bunt 1996] December 6, 2003

Concluding Remarks q Locality has returned great value Ø helps us to understand why

Concluding Remarks q Locality has returned great value Ø helps us to understand why certain approaches to resource management are effective (or ineffective) Ø inspires new approaches to managing resources q Productive application across a wide range of domains reflects that locality speaks to a basic behavioural property (“concentration of productivity”) q Should be, and will continue to be, an important research topic Temporal and Spatial Locality: A Time and a Place for Everything Slide of 29 December 6, 2003