Cache Configuration
Cache Configuration
1.CPU Cache
The CPU cache is a high-speed data storage mechanism used to temporarily store frequently accessed or
recently used data and instructions. It is situated between the main memory (RAM) and the central
processing unit (CPU) in a computer system.
2.Disk Cache
Disk cache operates transparently to the operating system and applications, intercepting disk I/O
requests and caching data blocks without requiring explicit user intervention. It has three main
functionalities:
i) Read Caching: Disk cache caches recently read data blocks from disk into memory. When a read
request is issued for a data block, the cache first checks if the block is present in memory (cache hit). If
found, the data is quickly retrieved from cache. Otherwise, the block is read from the disk (cache miss)
and stored in cache for future use.
ii) Write Caching: Disk cache can cache write operations to improve disk write performance. In write-
back mode, data is initially written to cache and acknowledged to the application, reducing disk I/O
latency. The cached data is later flushed to disk asynchronously.
iii) Prefetching: Disk cache can prefetch data blocks into memory based on access patterns or predictive
algorithms. By anticipating future access requests, prefetching helps reduce disk access latency and
improve overall system performance.
Operating System Cache: Many operating systems maintain a disk cache as part of their file system
implementation. The cache is managed by the operating system kernel and is used to buffer disk I/O
operations.
Disk Controller Cache: Some disk controllers feature built-in cache memory to accelerate disk
operations.
3.Web Cache
Web cache is used to store frequently accessed web pages and resources to reduce the latency
associated with fetching data from distant servers.
4.DNS Cache
DNS cache is used to store DNS lookup results to reduce the latency associated with resolving domain
names to IP addresses.
5.Cache Memory
L1 Cache: Extremely fast but relatively small, and is usually embedded in the processor chip as CPU
cache.
L2 Cache: Often more capacious than L1. L2 cache may be embedded on the CPU, or it can be on a
separate chip or coprocessor and have a high-speed alternative system bus connecting the cache and
CPU.
Level 3 (L3) Cache: Specialized memory developed to improve the performance of L1 and L2. L1 or L2
can be significantly faster than L3, though L3 is usually double the speed of DRAM. With multicore
processors, each core can have dedicated L1 and L2 cache, but they can share an L3 cache.