Supporting Soft Real-Time Tasks in the Xen Hypervisor Min Lee ∗1 , A. S. Krishnakumar 2 , P. Krishnan 2 , Navjot Singh 2 , Shalini Yajnik 2 1 Georgia Institute of Technology Atlanta, GA, USA minlee@cc.gatech.edu 2 Avaya Labs Basking Ridge, NJ, USA {ask, pk, singh, shalini}@avaya.com ABSTRACT Virtualization technology enables server consolidation and has given an impetus to low-cost green data centers. However, current hypervisors do not provide adequate support for real-time applications, and this has limited the adoption of virtualization in some domains. Soft real-time applications, such as media-based ones, are impeded by components of virtualization including low- performance virtualization I/O, increased scheduling latency, and shared-cache contention. The virtual machine scheduler is central to all these issues. The goal in this paper is to adapt the virtual machine scheduler to be more soft-real-time friendly. We improve two aspects of the VMM scheduler – managing scheduling latency as a first-class resource and managing shared caches. We use enterprise IP telephony as an illustrative soft real- time workload and design a scheduler S that incorporates the knowledge of soft real-time applications in all aspects of the scheduler to support responsiveness. For this we first define a laxity value that can be interpreted as the target scheduling latency that the workload desires. The load balancer is also designed to minimize the latency for real-time tasks. For cache management, we take cache-affinity into account for real time tasks and load-balance accordingly to prevent cache thrashing. We measured cache misses and demonstrated that cache management is essential for soft real time tasks. Although our scheduler S employs a different design philosophy, interestingly enough it can be implemented with simple modifications to the Xen hypervisor’s credit scheduler. Our experiments demonstrate that the Xen scheduler with our modifications can support soft real-time guests well, without penalizing non-real-time domains. Categories and Subject Descriptors D.4.1 [OPERATING SYSTEMS]: Process Management – Scheduling General Terms Performance, Design, Experimentation Keywords Virtualization, Xen, Enterprise telephony workloads, Server consolidation, Laxity * * This work was done when Min Lee was an intern at Avaya Labs. Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. VEE’10, March 17–19, 2010, Pittsburgh, Pennsylvania, USA. Copyright 2010 ACM 978-1-60558-910-7/10/03…$10.00. 1. INTRODUCTION Virtualization-enabled server consolidation helps in the effective management of resources and the deployment of green data centers. The availability of increased computing power with the introduction of more powerful multi-core processors is accelerating this trend. Virtualization allows the sharing of the underlying physical machine resources between different virtual machines or domains, each running its own operating system. The software layer providing the virtualization is called the hypervisor or the virtual machine monitor (VMM). The VMM ensures isolation between the virtual machines and is responsible for scheduling them on the available processors. There are many popular virtualization implementations, and a popular open- source platform is Xen [1]. In the rest of this paper, our discussion will be centered around the Xen virtualization platform, although the concepts can be applied more generally to other systems also. Virtualization has been successfully used with many different application classes. However, some applications like IP telephony media servers and audio and video servers demonstrate inadequate performance when run on virtualized platforms [2][3]. While traditionally considered real-time, such applications have enough intelligence to tolerate the lack of hard guarantees by the underlying server and network, and can be more accurately categorized as soft real-time applications. Although such applications do not require hard guarantees, they are unique in that they require the underlying platform to support both low latency and provide adequate computational resources in a timely fashion for completion of their tasks. Both these aspects are intimately intertwined with the logic of the virtual machine scheduler. While techniques have been introduced into schedulers to boost blocked domains upon receipt of an I/O event to improve latency [4] and I/O bypass techniques involving hardware support could mitigate the latency bottleneck [5], the twin requirements of low latency and adequate computational resources imply that the virtual machine scheduler must have the ability to support domains hosting such applications. Our goal in this paper is to distill the requirements of such soft real-time application domains and design an SMP (symmetric multi-processor) scheduler S that can support them. We found that our requirements for soft real-time application domains could be encapsulated using a single parameter that we call laxity which captures the target scheduling latency desired by the domain. The concept of laxity not only provides an explicit target latency hint to the scheduler in its decision making process, but also allows it to better prioritize and load balance the domains in an SMP environment. Xen’s existing default credit scheduler [6] is a proportional fair share CPU scheduler that is work conserving on SMP hosts. Although our scheduler employs a different design 97