Functionally Partitioned File Caching in Virtualized Environments Zhe Zhang Han Chen Hui Lei {Zhezhang,Chenhan,Hlei}@Us.Ibm.Com IBM T

Functionally Partitioned File Caching in Virtualized Environments Zhe Zhang Han Chen Hui Lei {Zhezhang,Chenhan,Hlei}@Us.Ibm.Com IBM T

Small is Big: Functionally Partitioned File Caching in Virtualized Environments Zhe Zhang Han Chen Hui Lei fzhezhang,chenhan,[email protected] IBM T. J. Watson Research Center Abstract gressive. Along the horizontal dimension, different VM File cache management is among the most important fac- guests often contain identical or similar files, such as the tors affecting the performance of a cloud computing sys- OS, database software, utilities, and so forth. However, tem. To achieve higher economies of scale, virtual ma- such content similarity may not be easily exploited. chines are often overcommitted, which creates high mem- Redundant caching significantly reduces the effective ory pressure. Thus it is essential to eliminate dupli- cache size. This problem is exacerbated when a large cate data in the host and guest caches to boost perfor- number of VMs are over-provisioned on a physical host, mance. Existing cache deduplication solutions are based which increases competition for the limited cache space. on complex algorithms, or incur high runtime overhead, Unfortunately, over-provisioning is a common practice by and therefore are not widely applicable. In this paper cloud providers for better cost saving. we present a simple and lightweight mechanism based on A number of techniques have been proposed to miti- functional partitioning. In our mechanism, the respon- gate redundant caching in a virtualized environment, and sibility of each cache becomes smaller: the host only they mainly fall into one of two categories. Cooperative caches data in base images and a VM guest only caches caching mechanisms [6, 10, 11] leverage knowledge on its own “private data”, which is generated after the VM what is cached in other caches to make better cache re- has started. As a result, the overall effective cache size placement decisions. This inevitably involves intricate becomes bigger. Our method requires very small change communication among multiple virtual or physical ma- to existing software (15 lines of new/modified code) to chines. The resultant complexity in development and achieves big performance improvements – more than 40% maintenance causes resistance from cloud operators. Page performance gains in high memory pressure settings. sharing mechanisms [13, 16, 17] rely on frequent memory scanning or tracing to merge data blocks with identical 1 Introduction content. They achieve memory savings at the cost of high File cache management is among the most significant fac- processing overhead. In a general-purpose cloud com- tors affecting a computing system’s performance. To hide puting system, where workload patterns cannot be pre- or mitigate the ever enlarging gap between CPU and disk dicted, it is difficult to determine whether and when to en- I/O speeds, the OS and applications normally use large able such mechanisms. Due to their respective limitations, memory spaces to cache file data. Researchers have also neither cooperative caching nor page sharing mechanisms proposed running applications entirely in memory in or- have seen wide adoption in production systems. der to eliminate the bottleneck of file access [14]. Al- We address the problem from a novel angle, by follow- though cache space can be used to serve both read and ing the principle of functional partitioning and making write requests, read requests are mostly synchronous and each cache serve mostly distinct portions of data requests. thus are more sensitive to the effectiveness of cache man- To the extent that different caches contain different con- agement. We focus on improving file read performance tent, redundant caching can be minimized or eliminated. in the remaining of this paper. Effective handling of write Two extreme methods are to use the host cache to serve requests is beyond our current work scope. all requests and completely bypass guest caches, and vice Optimizing file cache management is not easy. The versa. However, the former method causes frequent con- problem is made even more challenging by the advent text switch for guests to access host memory, while the of cloud computing. A server in a cloud datacenter suf- latter does not facilitate the sharing of common blocks fers from two types of redundant caching. Along the ver- across VM guests. We advocate a partitioned caching tical dimension, virtualization leads to a longer file I/O scheme where the host cache keeps data with high chance path consisting of nested software stacks [9]. Depending of being shared by multiple guests, and each VM guest on the caching policy, a file block may be cached in the keeps data that is likely to be used by itself only. OS page caches of both the VM guest and the hypervi- Based on the observation of high content similarity sor host. Besides cache space wastage, this also causes among VM images [5], and the intuitive assumption that compounded prefetching, which is likely to be overly ag- two VM guests are unlikely to generate private data 1 blocks with identical content, we assign base image data memory resource is scarce, the duplicates cause reduced to be cached on the host, and VM private data to be cached cache utilization and thus overall performance degrada- on each guest. 1 This way, the responsibility of each host tion. Moreover, guest level prefetching makes the file ac- or guest cache becomes smaller, and the overall effec- cess pattern appear sequential even when it is purely ran- tive cache size becomes bigger. This simple, lightweight dom, this cause inaccurate and unnecessary prefetching at method requires only small changes to existing OS and the host level. This is the default policy of the commonly virtualization driver (15 lines of new/modified code in our used libvirt Linux virtualization toolkit. implementation) to achieves big performance improve- Host cache = OFF, guest cache = ON Intuitively, the ments (more than 40% improvement in high memory guest OS has the most accurate knowledge about its I/O pressure settings) over policies used in existing produc- pattern, and is therefore the best place to keep page tion systems. caches. But it fails to take advantage of any free host 2 Current Practice memory and possibility for content-aware sharing. Exper- In a virtualization environment, a read request for a file iments suggest that a popular IaaS cloud uses this policy. block goes through multiple software layers. Let’s first Host cache = ON, guest cache = OFF When the host is examine the cache performance characteristics and then fully responsible for I/O caching, guest memory require- analyze the caching policies used in current practices. ment is reduced. In theory, this policy can achieve sig- 2.1 I/O Performance Analysis nificant memory saving when cache blocks are dedupli- A read request is first checked against the guest page cated with content-aware techniques. But with real-world cache. If it is a hit, the access latency is 1 memory copy workloads, any benefit may be negated by high computa- from the guest cache to the application space. If there is a tion and context switch overheads. miss in the guest page cache, the request is forwarded to Host cache = OFF, guest cache = OFF With this pol- the guest virtual disk, and a new cache page in the guest icy, all file requests go directly to the disk. The system is allocated. This virtual disk read request is translated suffers from heavy I/O load. No production system would by the I/O virtualization layer (e.g., qemu virtio) to a read conceivably use this policy. request to the image file at the host. To the best of our knowledge, current production The host read request is then checked against the host clouds use one of the two polices with guest cache = ON. page cache. If it is a hit, the I/O virtualization layer trans- One may be advantageous over the other depending on fers the block from the host page cache to the guest page the resource availability of the host machine. But none of cache, thus resulting in 2 memory copies in the entire ac- them effectively leverages the content similarity among cess path. If there is a miss at the host, disk (or network) the VM guests to compress their cache space usage. I/O is initiated to fetch the missing block from the actual file system. In this case, the total latency is comprised of 3 Functionally Partitioned File Caching 2 memory copies and 1 physical device transfer. We aim to develop a new cache management mechanism Additional factors further influence the I/O perfor- that fully utilizes the cache space on each VM guest and mance. Current Linux kernels adopt an aggressive the host, while avoiding duplicate caching of identical prefetching policy, which appends a number of ensuing data blocks. The mechanism is aimed for general-purpose blocks to the original request. The prefetching action is virtualization environments. Therefore, it should be as compounded and amplified with virtualization. Addition- simple as possible and avoid workload-specific optimiza- ally, each guest cache miss generates a system call to the tions. It should also be lightweight, because in a resource- host OS, causing an additional context switch. Our exper- overcommitted system, any optimization effort should be iments on a typical x86 server show that accessing guest extremely cautious about the overhead it incurs. memory is 2 times faster than host memory, and accessing 3.1 High Level Design host memory is 10 times faster than host disk. Our solution is based on the principle of functional par- 2.2 Cache configurations titioning, which avoids expensive bookkeeping by setting The host cache and the guest cache can be independently up simple rules for each component to easily understand configured to be ON or OFF in the storage hierarchy, re- its own portion of tasks or data.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    6 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us