Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Performance of Docker vs VMs
Presented By
Ali Hussain
August 21, 2014
Today’s Presenter:
Ali Hussain
Co-founder & CTO Flux7
Prev: CPU Performance Analyst at Intel and ARM
Flux7: Cloud and DevO...
Other team members
Samprita Hegde
Performance Engineer at Flux7
Setup, execution, and collection of data
Check out our wor...
Agenda
Background
Experimental results & deductions
Application in the real world
What is Docker?
Linux OS isolation
tools made easy
A Docker container
looks like a
virtual machine
Provide additional
‘goo...
Holy Grail of “Virtualization”
ApplicationHost
Hardware
and OS
An application needs to communicate with
outside world: H/W, OS, other processes
Communication
Network
FS
Packages
libraries
ApplicationHost
Hardware
and OS
The application communicates through certain c...
CPU steal
Memory
full
Package
versions
File path
conflicts
Port
conflicts
Communication
Conflict
Isolatedbyabstractionlaye...
What we want
Allow
communication
Prevent conflict
over resources
A continuum of
abstraction levels
How we pay for it
Start and stop time
Resource overhead
(Memory, CPU)
Increased latency
(Disk, Network)
Snapshot time and
...
Where is Docker on this spectrum?
Virtual
Machines
Native
Docker Abstraction
Use isolation features of the Linux kernel to give a VM-like
environment
Filesystem using chroot jails
...
Test Platform
Memory
47 GB RAM
23 GB Swap
Processor
Intel(R) Core
(TM) i7 CPU
OS: Ubuntu 12.04 LTS , kernel - 3.8.0-33-gen...
Start and stop times
Start Time Stop Time
Docker Containers <50ms <50ms
VMs 30-45 seconds 5-10 seconds
Memory
No overhead of running a guest kernel
Docker requires consumed memory not provisioned memory
CPU Overhead - Methodology
Measured using coremark
Microbenchmark measuring CPU performance
CPU Overhead
CoreMark
Score
Docker KVM
0
15000
30000
45000
60000
Native
CPU Overhead
No noticeable difference between native, KVM, and Docker
performance
KVM uses ~1.5% more CPU usage compared t...
Network Performance - Methodology
Performance measured using iperf
Care about both latency and throughput
Network Throughput
0
15
30
45
60
Bandwidth
(Gbits/sec)
Theoretical
Scenario:
Server and Client
on same instance
Native
Doc...
Network Throughput
Docker with port
forwarding
Docker with a
dedicated private IP
address
0
2.5
5
7.5
10
Bandwidth
(Gbits/...
Network latency (lower is better)
Docker with port
forwarding in a
VPC
Docker with a
dedicated private IP
address
0
20
40
...
Network Performance
Both Docker and KVM can saturate 10GbE
Docker running inside a VM can still saturate 10GbE
Docker redi...
Disk Bandwidth
Measured using FIO - Stresses disk with different streams
A lot of variation but no clear winner
Different ...
Application Benchmarking - Wikibench
Benchmark summary
Load performance:
Native, KVM, and Docker
performed comparably
H/W and S/W advances in
virtualization
Ov...
New technologies provide benefit only if
you drop the rules that were designed to
overcome the shortcomings of the old
tec...
Use Cases
Configuration
Management
Multiple instances
per box
Basic unit of
provisioning
resources
Configuration Management
Create configuration to work in your canonical environment and
emulate it
We already do this
○ Vi...
Configuration Management
Why Docker?
Consistent
environment
Many dev niceties
No memory overhead
Minimize performance
over...
Configuration Management
Running identical code + configs across environments
Better code pipeline management
What we get?
Use Cases
Configuration
Management
Multiple instances
per box
Basic unit of
provisioning
resources
Multiple Instances per box
Multiple instances each running in own Docker container
Containers may communicate over TCP
Multiple Instances per box
Why Docker?
No idle memory and
CPU overhead
Process and FS
isolation
Port forwarding
Multiple Instances per box
High fidelity local
dev environments
What we get
Multi-tenancy Server consolidation
Use Cases
Configuration
Management
Multiple instances
per box
Basic unit of
provisioning
resources
Basic Unit of Resource Provisioning
Allocate Docker containers instead of VMs
Can be both
Persistent resources
Very short ...
Basic Unit of Resource Provisioning
Sharing of
resources
Why Docker
Management of
multiple images
Quick start and
stop tim...
Basic Unit of Resource Provisioning
Faster provisioning
What we get
Lower overhead on
host
Config management
Thank you, Docker!
For developing a very cool piece of technology
For making it OpenSource
Special thanks to Jerome Petazz...
Thank You!
Twitter: @Flux7Labs
Blog: blog.flux7.com
Upcoming SlideShare
Loading in …5
×

Performance of Docker vs VMs

51,348 views

Published on

Docker, a wrapper around LXC containers, provides an excellent mechanism for low overhead virtualization. Docker allows isolated environments to be created in a single machine without imposing a performance overhead.

As organizations look for lightweight alternatives to using virtual machines, they are seeking a better understanding of Docker’s performance capabilities. This talk presents the results from Docker performance evaluations, starting with a bottom-up approach, comparing Docker against virtual machines and native on key performance indicators using microbenchmarks.

The performance based on a series of real-world benchmarks was presented. Also gain insights into how Docker works and how to set up Docker to fit individual needs.

Published in: Technology
  • Be the first to comment

Performance of Docker vs VMs

  1. 1. Performance of Docker vs VMs Presented By Ali Hussain August 21, 2014
  2. 2. Today’s Presenter: Ali Hussain Co-founder & CTO Flux7 Prev: CPU Performance Analyst at Intel and ARM Flux7: Cloud and DevOps Solutions Cloud and Devops for Web teams Enterprise DevOps management AWS Certified Team Partners: Clients:
  3. 3. Other team members Samprita Hegde Performance Engineer at Flux7 Setup, execution, and collection of data Check out our work on blog.flux7.com
  4. 4. Agenda Background Experimental results & deductions Application in the real world
  5. 5. What is Docker? Linux OS isolation tools made easy A Docker container looks like a virtual machine Provide additional ‘goodies’ for app development
  6. 6. Holy Grail of “Virtualization”
  7. 7. ApplicationHost Hardware and OS An application needs to communicate with outside world: H/W, OS, other processes
  8. 8. Communication Network FS Packages libraries ApplicationHost Hardware and OS The application communicates through certain channels but each of these channels can also cause conflicts with other applications on the system CPU steal Memory full Package versions File path conflicts Port conflicts Conflict
  9. 9. CPU steal Memory full Package versions File path conflicts Port conflicts Communication Conflict Isolatedbyabstractionlayer AbstractionLayer Network FS Packages libraries ApplicationHost Hardware and OS Adding an abstraction layer allows the needed communication to happen as desired while isolating the the sources of contention
  10. 10. What we want Allow communication Prevent conflict over resources A continuum of abstraction levels
  11. 11. How we pay for it Start and stop time Resource overhead (Memory, CPU) Increased latency (Disk, Network) Snapshot time and space
  12. 12. Where is Docker on this spectrum? Virtual Machines Native
  13. 13. Docker Abstraction Use isolation features of the Linux kernel to give a VM-like environment Filesystem using chroot jails Network using port forwarding Resource and process isolation using cgroups
  14. 14. Test Platform Memory 47 GB RAM 23 GB Swap Processor Intel(R) Core (TM) i7 CPU OS: Ubuntu 12.04 LTS , kernel - 3.8.0-33-generic Disk 2 drive raid1 (mirroring) configuration Docker version: 0.7.2, build 28b162e * Some tests run on AWS because of specific needs
  15. 15. Start and stop times Start Time Stop Time Docker Containers <50ms <50ms VMs 30-45 seconds 5-10 seconds
  16. 16. Memory No overhead of running a guest kernel Docker requires consumed memory not provisioned memory
  17. 17. CPU Overhead - Methodology Measured using coremark Microbenchmark measuring CPU performance
  18. 18. CPU Overhead CoreMark Score Docker KVM 0 15000 30000 45000 60000 Native
  19. 19. CPU Overhead No noticeable difference between native, KVM, and Docker performance KVM uses ~1.5% more CPU usage compared to Docker when idle
  20. 20. Network Performance - Methodology Performance measured using iperf Care about both latency and throughput
  21. 21. Network Throughput 0 15 30 45 60 Bandwidth (Gbits/sec) Theoretical Scenario: Server and Client on same instance Native Docker with port forwarding Docker dedicated IP KVM with network bridge
  22. 22. Network Throughput Docker with port forwarding Docker with a dedicated private IP address 0 2.5 5 7.5 10 Bandwidth (Gbits/sec) Practical Scenario: Server and Client on different instances iperf on “native” c3.8xlarge instance
  23. 23. Network latency (lower is better) Docker with port forwarding in a VPC Docker with a dedicated private IP address 0 20 40 60 80 Latency (usec) iperf on native c3.8xlarge instance
  24. 24. Network Performance Both Docker and KVM can saturate 10GbE Docker running inside a VM can still saturate 10GbE Docker redirection latency ~10us
  25. 25. Disk Bandwidth Measured using FIO - Stresses disk with different streams A lot of variation but no clear winner Different drivers causing differences with different scenarios
  26. 26. Application Benchmarking - Wikibench
  27. 27. Benchmark summary Load performance: Native, KVM, and Docker performed comparably H/W and S/W advances in virtualization Over micro and macro benchmarks Docker shines in Idle resource usage Start and stop times
  28. 28. New technologies provide benefit only if you drop the rules that were designed to overcome the shortcomings of the old technology -- Dr. Eliyahu Goldratt The nature of disruptive changes
  29. 29. Use Cases Configuration Management Multiple instances per box Basic unit of provisioning resources
  30. 30. Configuration Management Create configuration to work in your canonical environment and emulate it We already do this ○ Virtual machines ○ Python virtualenvs
  31. 31. Configuration Management Why Docker? Consistent environment Many dev niceties No memory overhead Minimize performance overhead
  32. 32. Configuration Management Running identical code + configs across environments Better code pipeline management What we get?
  33. 33. Use Cases Configuration Management Multiple instances per box Basic unit of provisioning resources
  34. 34. Multiple Instances per box Multiple instances each running in own Docker container Containers may communicate over TCP
  35. 35. Multiple Instances per box Why Docker? No idle memory and CPU overhead Process and FS isolation Port forwarding
  36. 36. Multiple Instances per box High fidelity local dev environments What we get Multi-tenancy Server consolidation
  37. 37. Use Cases Configuration Management Multiple instances per box Basic unit of provisioning resources
  38. 38. Basic Unit of Resource Provisioning Allocate Docker containers instead of VMs Can be both Persistent resources Very short tasks
  39. 39. Basic Unit of Resource Provisioning Sharing of resources Why Docker Management of multiple images Quick start and stop times
  40. 40. Basic Unit of Resource Provisioning Faster provisioning What we get Lower overhead on host Config management
  41. 41. Thank you, Docker! For developing a very cool piece of technology For making it OpenSource Special thanks to Jerome Petazzoni for supporting us
  42. 42. Thank You! Twitter: @Flux7Labs Blog: blog.flux7.com

×