Comparative evaluation of Virtual Environments: Virtual Comparative evaluation of Virtual Environments:

  • View
    0

  • Download
    0

Embed Size (px)

Text of Comparative evaluation of Virtual Environments: Virtual Comparative evaluation of Virtual...

  • Comparative evaluation of Virtual Environments:

    Virtual Machines and Containers

    by

    Ranjan Dhar

    Dissertation

    Presented to the

    University of Dublin, Trinity College

    in fulfillment

    of the requirements

    for the Degree of

    Master of Science in Computer Science

    University of Dublin, Trinity College

    August 2016

  • Declaration

    I, the undersigned, declare that this work has not previously been submitted as an

    exercise for a degree at this, or any other University, and that unless otherwise stated, is

    my own work.

    Ranjan Dhar

    August 29, 2016

  • Permission to Lend and/or Copy

    I, the undersigned, agree that Trinity College Library may lend or copy this thesis

    upon request.

    Ranjan Dhar

    August 29, 2016

  • Acknowledgments

    I would like to express my sincere gratitude to my supervisor Prof. Stefan Weber for

    the continuous support throughout my time as his student, for his patience, motivation,

    enthusiasm, and immense knowledge. His guidance helped me during the time of research

    and writing of this thesis. I could not have imagined having a better supervisor and

    mentor for my research work.

    Last but not the least, I would like to thank my parents and friends for supporting

    me throughout my life.

    Ranjan Dhar

    University of Dublin, Trinity College

    August 2016

    iv

  • Comparative evaluation of Virtual Environments:

    Virtual Machines and Containers

    Ranjan Dhar

    University of Dublin, Trinity College, 2016

    Supervisor: Stefan Weber

    Cloud computing is a major component of the IT industry. Current cloud comput-

    ing solutions make extensive use of virtual machines because they offer a high degree of

    isolation as well as an opportunity to optimize for effective utilization of available in-

    frastructure. However, virtual machines also rely on a degree of abstraction which may

    result in performance degradation thereby affecting the users or customers. New advance-

    ment in container-based virtualization techniques simplifies deployment and offers similar

    opportunities in the control and optimization of resources.

    The availability of these two alternative technologies has resulted in a number contrast-

    ing opinions and studies. However, the advantages and disadvantages of each technology

    when compared against its alternative are not clear, which leads to difficulties for infras-

    tructure providers who aim to optimize the use of their resources and the service provided

    to their customers.

    In this study, we explore the performance profile of traditional virtual machine de-

    ployments and contrast it with containers. We use a set of workloads that stresses CPU,

    File I/O and MySQL server to evaluate the performance while scaling up the deployments

    v

  • incrementally. We also evaluate the migration performance of the two on the same net-

    work. We use KVM as hypervisor for virtual machines and Docker as container manager.

    Our results point out that containers perform better in terms of both density and boot

    latency; however, the results are reversed in terms of migration performance due to the

    maturity of migration mechanisms for virtual machines which result in comparatively low

    service downtime. We also discuss the potential performance inhibiting factors as well as

    future optimizations.

    vi

  • Contents

    Acknowledgments iv

    Abstract v

    List of Tables x

    List of Figures xi

    Chapter 1 Introduction 1

    1.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

    1.2 Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

    1.3 Outline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

    Chapter 2 Background 10

    2.1 Types of Virtualization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

    2.1.1 CPU Virtualization . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

    2.1.2 Full Virtualization . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

    2.1.3 Para virtualization . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

    2.1.4 Host OS virtualization . . . . . . . . . . . . . . . . . . . . . . . . . 13

    2.2 OS level virtualization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

    2.3 Evolution of Containers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

    2.3.1 Solaris Containers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

    2.3.2 BSD Jails . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

    vii

  • 2.4 Containers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

    2.4.1 Linux Containers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

    2.4.2 Docker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

    2.4.3 Docker Components . . . . . . . . . . . . . . . . . . . . . . . . . . 21

    2.5 Virtualization Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

    2.5.1 Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

    2.5.2 Density . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

    2.5.3 Latency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

    2.6 Migration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

    2.6.1 Use cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

    2.6.2 Assumptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

    2.6.3 Types of Migration . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

    2.6.4 Live Migration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

    Chapter 3 State of Art 29

    3.1 Virtual Machines Vs Containers Performance . . . . . . . . . . . . . . . . . 29

    3.2 Virtual Machine Migration . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

    Chapter 4 Density 55

    4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

    4.2 Benchmarking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57

    4.3 Experimental Setup and Configuration . . . . . . . . . . . . . . . . . . . . 58

    4.4 Technologies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58

    4.4.1 KVM,QEMU & LIBVIRT . . . . . . . . . . . . . . . . . . . . . . . 58

    4.4.2 Docker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61

    4.5 Test Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61

    4.5.1 CPU Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61

    4.5.2 File I/O Performance . . . . . . . . . . . . . . . . . . . . . . . . . . 65

    4.5.3 MySQL Performance . . . . . . . . . . . . . . . . . . . . . . . . . . 71

    viii

  • Chapter 5 Latency 76

    5.0.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77

    5.0.2 Experiment, Analysis & Conclusion . . . . . . . . . . . . . . . . . . 78

    5.0.3 Optimizations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82

    Chapter 6 Migration 86

    6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86

    6.2 Benchmark . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88

    6.3 Experimental setup and Configurations . . . . . . . . . . . . . . . . . . . . 89

    6.4 Technologies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93

    6.4.1 KVM Migration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93

    6.4.2 Docker Migration . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94

    6.5 Evaluation and Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . 96

    6.5.1 Total Migration Time . . . . . . . . . . . . . . . . . . . . . . . . . . 96

    6.5.2 Service Downtime . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98

    Chapter 7 Conclusion 101

    7.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101

    7.2 Future Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104

    7.3 Contribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105

    7.4 Final Remarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105

    Appendix A Abbreviations 107

    Bibliography 109

    ix

  • List of Tables

    3.1 Container Implementation Comparison . . . . . . . . . . . . . . . . . . . . 34

    3.2 Model Prediction Error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

    4.1 System Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59

    4.2 Native Performance Profile . . . . . . . . . . . . . . . . . . . . . . . . . . . 64

    4.3 Native Performance Profile for File I/O . . . . . . . . . . . . . . . . . . . . 69

    4.4 Per req. stats of 8 running VMs . . . . . . . . . . . . . . . . . . . . . . . . 74

    4.5 Per req. stats of 8 running Containers . . . . . . . . . . . . . . . . . . . . . 75

    5.1 Boot up & Shut down time of VMs . . . . . . . .