Cache (computing): Difference between revisions

Content deleted Content added
m review: add link. wording.
 
(10 intermediate revisions by 8 users not shown)
Line 7:
 
In [[computing]], a '''cache''' ({{IPAc-en|audio=LL-Q1860 (eng)-Back ache-cache.wav|k|æ|ʃ}} {{respell|KASH}})<ref>
{{cite web|url=http://www.oxforddictionaries.com/definition/english/cache|archive-url=https://web.archive.org/web/20120818122040/http://oxforddictionaries.com/definition/english/cache|url-status=dead|archive-date=18 August 2012|title=Cache|work=Oxford Dictionaries|access-date=2 August 2016}}</ref> is a hardware or software component that stores data so that future requests for that data can be served faster; the data stored in a cache might be the result of an earlier computation or a copy of data stored elsewhere. A '''cache hit''' occurs when the requested data can be found in a cache, while a '''cache miss''' occurs when it cannot. Cache hits are served by reading data from the cache, which is faster than recomputing a result or reading from a slower data store; thus, the more requests that can be served from the cache, the faster the system performs.<ref>{{Cite journal|last1=Zhong|first1=Liang|last2=Zheng|first2=Xueqian|last3=Liu|first3=Yong|last4=Wang|first4=Mengting|last5=Cao|first5=Yang|date=February 2020|title=Cache hit ratio maximization in device-to-device communications overlaying cellular networks|url=http://dx.doi.org/10.23919/jcc.2020.02.018|journal=China Communications|volume=17|issue=2|pages=232–238|doi=10.23919/jcc.2020.02.018|s2cid=212649328|issn=1673-5447|url-access=subscription}}</ref>
 
To be cost-effective, caches must be relatively small. Nevertheless, caches are effective in many areas of computing because typical [[Application software|computer applications]] access data with a high degree of [[locality of reference]]. Such access patterns exhibit temporal locality, where data is requested that has been recently requested, and spatial locality, where data is requested that is stored near data that has already been requested.
Line 69:
Earlier [[graphics processing unit]]s (GPUs) often had limited read-only [[texture cache]]s and used [[swizzling (computer graphics)|swizzling]] to improve 2D [[locality of reference]]. [[Cache miss]]es would drastically affect performance, e.g. if [[mipmapping]] was not used. Caching was important to leverage 32-bit (and wider) transfers for texture data that was often as little as 4 bits per pixel.
 
As GPUs advanced, supporting [[General-purpose computing on graphics processing units (software)|general-purpose computing on graphics processing units]] and [[compute kernel]]s, they have developed progressively larger and increasingly general caches, including [[instruction cache]]s for [[shader]]s, exhibiting functionality commonly found in CPU caches. These caches have grown to handle [[synchronization primitive]]s between threads and [[atomic operation]]s, and interface with a CPU-style MMU.
 
===DSPs===
Line 88:
The time aware least recently used (TLRU) is a variant of LRU designed for the situation where the stored contents in cache have a valid lifetime. The algorithm is suitable in network cache applications, such as ICN, [[content delivery network]]s (CDNs) and distributed networks in general. TLRU introduces a new term: time to use (TTU). TTU is a time stamp on content which stipulates the usability time for the content based on the locality of the content and information from the content publisher. Owing to this locality-based time stamp, TTU provides more control to the local administrator to regulate in-network storage.
 
In the TLRU algorithm, when a piece of content arrives, a cache node calculates the local TTU value based on the TTU value assigned by the content publisher. The local TTU value is calculated by using a locally- defined function. Once the local TTU value is calculated the replacement of content is performed on a subset of the total content stored in cache node. The TLRU ensures that less popular and short-lived content should be replaced with incoming content.<ref>{{cite conference|last1=Bilal|first1=Muhammad|first2=Shin-Gak|last2=Kang|conference=16th International Conference on Advanced Communication Technology|title=Time Aware Least Recent Used (TLRU) cache management policy in ICN|year=2014|pages=528–532|doi=10.1109/ICACT.2014.6779016|arxiv=1801.00390|bibcode=2018arXiv180100390B|isbn=978-89-968650-3-2|s2cid=830503}}</ref>
 
=====Least frequent recently used=====
Line 115:
 
===Content delivery network===
{{Mainmain|Content delivery network}}
A content delivery network (CDN) is a network of distributed servers that deliver pages and other [[web content]] to a user, based on the geographic locations of the user, the origin of the web page and the content delivery server.
 
A [[content delivery network]] (CDN) is a network of distributed servers that deliver pages and other [[web content]] to a user, based on the geographic locations of the user, the origin of the web page and the content delivery server.
CDNs were introduced in the late 1990s as a way to speed up the delivery of static content, such as HTML pages, images and videos. By replicating content on multiple servers around the world and delivering it to users based on their ___location, CDNs can significantly improve the speed and availability of a website or application. When a user requests a piece of content, the CDN will check to see if it has a copy of the content in its cache. If it does, the CDN will deliver the content to the user from the cache.<ref name=":0">{{cite web|url=https://people.cs.umass.edu/~ramesh/Site/PUBLICATIONS_files/DMPPSW02.pdf|title=Globally Distributed Content Delivery, by J. Dilley, B. Maggs, J. Parikh, H. Prokop, R. Sitaraman and B. Weihl, IEEE Internet Computing, Volume 6, Issue 5, November 2002.|access-date=2019-10-25|archive-url=https://web.archive.org/web/20170809231307/http://people.cs.umass.edu/~ramesh/Site/PUBLICATIONS_files/DMPPSW02.pdf|archive-date=2017-08-09|url-status=live}}</ref><!--[[User:Kvng/RTH]]-->
 
CDNs were introduced in the late 1990s as a way to speed up the delivery of static content, such as HTML pages, images and videos. By replicating content on multiple servers around the world and delivering it to users based on their ___location, CDNs can significantly improve the speed and availability of a website or application. When a user requests a piece of content, the CDN will check to see if it has a copy of the content in its cache. If it does, the CDN will deliver the content to the user from the cache.<ref name=":0">{{cite web|url=https://people.cs.umass.edu/~ramesh/Site/PUBLICATIONS_files/DMPPSW02.pdf|title=Globally Distributed Content Delivery, by J. Dilley, B. Maggs, J. Parikh, H. Prokop, R. Sitaraman and B. Weihl, IEEE Internet Computing, Volume 6, Issue 5, November 2002.|access-date=2019-10-25|archive-url=https://web.archive.org/web/20170809231307/http://people.cs.umass.edu/~ramesh/Site/PUBLICATIONS_files/DMPPSW02.pdf|archive-date=2017-08-09|url-status=live}}</ref><!--[[User:Kvng/RTH]]-->
 
===Cloud storage gateway===
{{Main|Cloud storage gateway}}
A [[cloud storage gateway, also known as an edge filer,]] is a [[hybrid cloud storage]] device that connects a local network to one or more [[cloud storage service]]s, typically [[object storage]] services such as [[Amazon S3]]. It provides a cache for frequently accessed data, providing high speed local access to frequently accessed data in the cloud storage service. Cloud storage gateways also provide additional benefits such as accessing cloud object storage through traditional file serving protocols as well as continued access to cached data during connectivity outages.<ref name="searchstorage1">{{cite web|url=https://www.techtarget.com/searchstorage/definition/cloud-storage-gateway|title=Definition: cloud storage gateway|work=SearchStorage|date=July 2014}}</ref>
 
===Other caches===
The BIND [[Domain Name SystemBIND|BIND DNS daemon]] daemon caches a mapping of ___domain names to [[IP address]]es, as does a [[DNS resolver]] library.
 
Write-through operation is common when operating over [[unreliable networks (like an Ethernet LAN)network]]s, because of the enormous complexity of the coherency protocol required between multiple write-back caches when communication is unreliable. For instance, web page caches and [[client-side]] caches for [[Network File System|networkdistributed file system]] cachess (like those in [[Network File System (protocol)|NFS]] or [[Server Message Block|SMB]]) are typically read-only or write-through specifically to keep the network protocol simple and reliable.
 
[[Web search engine|Search engine]]s also frequently make web pages they have indexed available from their cache.[[Search Forengine example, [[Googlecache|cache]] provides a "Cached" link next to each search result. This can prove useful when web pages from a web server are temporarily or permanently inaccessible.
 
[[Database caching]] can substantially improve the throughput of [[database]] applications, for example in the processing of [[Database index|indexes]], [[Data dictionary|data dictionaries]], and frequently used subsets of data.
 
A [[distributed cache]]<ref>{{cite journal|last1=Paul|first1=S.|last2=Fei|first2=Z.|date=1 February 2001|title=Distributed caching with centralized control|journal=Computer Communications|volume=24|issue=2|pages=256–268|citeseerx=10.1.1.38.1094|doi=10.1016/S0140-3664(00)00322-4}}<!--|access-date=18 November 2009--></ref> uses networked hosts to provide scalability, reliability and performance to the application.<ref>{{cite journal|last=Khan|first=Iqbal|title=Distributed Caching on the Path To Scalability|url=https://msdn.microsoft.com/magazine/dd942840.aspx|journal=MSDN|volume=24|issue=7|date=July 2009}}</ref> The hosts can be co-located or spread over different geographical regions.<!--[[User:Kvng/RTH]]-->
 
=={{anchor|The difference between buffer and cache}}<!--Former section name used in external links-->Buffer vs. cache==