Beating the Virtualization Tax for NoSQL Workloads with OSv
description
Transcript of Beating the Virtualization Tax for NoSQL Workloads with OSv
![Page 1: Beating the Virtualization Tax for NoSQL Workloads with OSv](https://reader034.fdocuments.in/reader034/viewer/2022052523/555d63bad8b42a0b778b4612/html5/thumbnails/1.jpg)
Beating the virtualization tax for NoSQL workloads with OSv
Don Marti and Glauber CostaCloudius Systems
![Page 2: Beating the Virtualization Tax for NoSQL Workloads with OSv](https://reader034.fdocuments.in/reader034/viewer/2022052523/555d63bad8b42a0b778b4612/html5/thumbnails/2.jpg)
Hardware
Hypervisor
guest OS
JVM
App Server
Java App
What is OSv?
guest OS
C++ App
Hardware
Hypervisor
OSv VM
App Server
Your App
OSv VM
Your App
Before After
![Page 3: Beating the Virtualization Tax for NoSQL Workloads with OSv](https://reader034.fdocuments.in/reader034/viewer/2022052523/555d63bad8b42a0b778b4612/html5/thumbnails/3.jpg)
Performance and Manageability
■ Performance■ Single address space■ Simplified networking
■ Manageability■ No local users■ No local config files
■ Simplicity: less than 1 second boot time
![Page 4: Beating the Virtualization Tax for NoSQL Workloads with OSv](https://reader034.fdocuments.in/reader034/viewer/2022052523/555d63bad8b42a0b778b4612/html5/thumbnails/4.jpg)
Trust is not free
Colocated (same CPU)
Apart(different CPU)
Linux 905 ns 13148 ns
OSv 328 ns 1402 ns
■ Context switch microbenchmark
![Page 5: Beating the Virtualization Tax for NoSQL Workloads with OSv](https://reader034.fdocuments.in/reader034/viewer/2022052523/555d63bad8b42a0b778b4612/html5/thumbnails/5.jpg)
No config files
■ REST API for all configurable items
■ AJAX GUI for config and management (optional)
![Page 6: Beating the Virtualization Tax for NoSQL Workloads with OSv](https://reader034.fdocuments.in/reader034/viewer/2022052523/555d63bad8b42a0b778b4612/html5/thumbnails/6.jpg)
VM build and deploy
■ Capstan: rapid VM build (and run)■ Docker-like config file■ Takes about 3 seconds to build■ Runs on any OS (written in Go)
![Page 7: Beating the Virtualization Tax for NoSQL Workloads with OSv](https://reader034.fdocuments.in/reader034/viewer/2022052523/555d63bad8b42a0b778b4612/html5/thumbnails/7.jpg)
1. Network performance
![Page 8: Beating the Virtualization Tax for NoSQL Workloads with OSv](https://reader034.fdocuments.in/reader034/viewer/2022052523/555d63bad8b42a0b778b4612/html5/thumbnails/8.jpg)
Traditional stack Network Channels
![Page 9: Beating the Virtualization Tax for NoSQL Workloads with OSv](https://reader034.fdocuments.in/reader034/viewer/2022052523/555d63bad8b42a0b778b4612/html5/thumbnails/9.jpg)
OSv-specific networking
■ Bypass socket layer■ full zero-copy achievable
![Page 10: Beating the Virtualization Tax for NoSQL Workloads with OSv](https://reader034.fdocuments.in/reader034/viewer/2022052523/555d63bad8b42a0b778b4612/html5/thumbnails/10.jpg)
Memcached benchmark
Requests/s (higher is better)
![Page 11: Beating the Virtualization Tax for NoSQL Workloads with OSv](https://reader034.fdocuments.in/reader034/viewer/2022052523/555d63bad8b42a0b778b4612/html5/thumbnails/11.jpg)
OSv networking: inbound
■ Handle inbound data without the overhead of the socket layer.
■ Called for every incoming packet.
![Page 12: Beating the Virtualization Tax for NoSQL Workloads with OSv](https://reader034.fdocuments.in/reader034/viewer/2022052523/555d63bad8b42a0b778b4612/html5/thumbnails/12.jpg)
OSv networking: outbound
■ Send the frame directly to the ifnet device.
■ PF hook is called with relevant locks held.
![Page 13: Beating the Virtualization Tax for NoSQL Workloads with OSv](https://reader034.fdocuments.in/reader034/viewer/2022052523/555d63bad8b42a0b778b4612/html5/thumbnails/13.jpg)
2. Memory management
![Page 14: Beating the Virtualization Tax for NoSQL Workloads with OSv](https://reader034.fdocuments.in/reader034/viewer/2022052523/555d63bad8b42a0b778b4612/html5/thumbnails/14.jpg)
Manual memory tuning
■ 240,000 Google hits for [jvm heap size]■ This is a job for a computer, not a human being.
![Page 15: Beating the Virtualization Tax for NoSQL Workloads with OSv](https://reader034.fdocuments.in/reader034/viewer/2022052523/555d63bad8b42a0b778b4612/html5/thumbnails/15.jpg)
JVM Memory System memory
Lend memory
Memory ballooning
![Page 16: Beating the Virtualization Tax for NoSQL Workloads with OSv](https://reader034.fdocuments.in/reader034/viewer/2022052523/555d63bad8b42a0b778b4612/html5/thumbnails/16.jpg)
Shrinker API
■ Register a callback■ OSv calls your shrinker■ No manual tuning of cache size
■ Used in osv-memcached
![Page 17: Beating the Virtualization Tax for NoSQL Workloads with OSv](https://reader034.fdocuments.in/reader034/viewer/2022052523/555d63bad8b42a0b778b4612/html5/thumbnails/17.jpg)
Redis on OSv
![Page 18: Beating the Virtualization Tax for NoSQL Workloads with OSv](https://reader034.fdocuments.in/reader034/viewer/2022052523/555d63bad8b42a0b778b4612/html5/thumbnails/18.jpg)
“porting” Redis
make CFLAGS="-fPIC" LDFLAGS="-shared" MALLOC=libc
■ -fPIC option■ -shared option■ MALLOC=libc (not required)
■ OSv malloc is integrated with kernel, optimized for small objects.
![Page 19: Beating the Virtualization Tax for NoSQL Workloads with OSv](https://reader034.fdocuments.in/reader034/viewer/2022052523/555d63bad8b42a0b778b4612/html5/thumbnails/19.jpg)
![Page 20: Beating the Virtualization Tax for NoSQL Workloads with OSv](https://reader034.fdocuments.in/reader034/viewer/2022052523/555d63bad8b42a0b778b4612/html5/thumbnails/20.jpg)
Details on Redis test
■ Ubuntu 14.04■ Affinity turned on in the Ubuntu guest
■ Both systems: Amazon c3.8xlarge■ 32 vCPUs■ 60GB RAM■ Intel Xeon E5-2680 v2 @ 2.8GHz■ 10 Gigabit networking
![Page 21: Beating the Virtualization Tax for NoSQL Workloads with OSv](https://reader034.fdocuments.in/reader034/viewer/2022052523/555d63bad8b42a0b778b4612/html5/thumbnails/21.jpg)
Redis details
■ Lua scripting, PUB/SUB, etc, it all works■ Redis uses fork for “BGSAVE” command.
■ This is the only functionality not supported.■ Single address space, no copy on write.■ Less than 20Mb redis image, now bootable
everywhere.
![Page 22: Beating the Virtualization Tax for NoSQL Workloads with OSv](https://reader034.fdocuments.in/reader034/viewer/2022052523/555d63bad8b42a0b778b4612/html5/thumbnails/22.jpg)
Conclusions
■ Memory and CPU intensive loads can have unacceptable performance under virtualization.
■ The OSv project has profiled important bottlenecks for NoSQL applications.
■ Virtual appliances available: Cassandra, Tomcat, Redis
■ Work in progress. Please join us.
![Page 23: Beating the Virtualization Tax for NoSQL Workloads with OSv](https://reader034.fdocuments.in/reader034/viewer/2022052523/555d63bad8b42a0b778b4612/html5/thumbnails/23.jpg)
Thank you
Download or try it in the cloud at: http://osv.io/
Follow @CloudiusSystems on Twitter
![Page 24: Beating the Virtualization Tax for NoSQL Workloads with OSv](https://reader034.fdocuments.in/reader034/viewer/2022052523/555d63bad8b42a0b778b4612/html5/thumbnails/24.jpg)
Begin backup slides
![Page 25: Beating the Virtualization Tax for NoSQL Workloads with OSv](https://reader034.fdocuments.in/reader034/viewer/2022052523/555d63bad8b42a0b778b4612/html5/thumbnails/25.jpg)
Run most workloads on any cloud
OSv
![Page 26: Beating the Virtualization Tax for NoSQL Workloads with OSv](https://reader034.fdocuments.in/reader034/viewer/2022052523/555d63bad8b42a0b778b4612/html5/thumbnails/26.jpg)
Rapid VM build and deploy
■ Build an OSv VM in ~3 seconds■ Small VMs (as small as 10MB) for fast deploy■ Boot in ~1 second for resilience and scaling■ Enable continuous delivery
![Page 27: Beating the Virtualization Tax for NoSQL Workloads with OSv](https://reader034.fdocuments.in/reader034/viewer/2022052523/555d63bad8b42a0b778b4612/html5/thumbnails/27.jpg)
Performance
■ System calls are free■ context switches are cheap (4x speed of recent Linux)
■ Network performance significantly faster■ around 20% with netperf over recent Linux■ more than 50% for some UDP workloads
■ SpecJVM between 3 and 5% faster■ Boots in < 1 second
■ As little as 100-200ms without local filesystem
![Page 28: Beating the Virtualization Tax for NoSQL Workloads with OSv](https://reader034.fdocuments.in/reader034/viewer/2022052523/555d63bad8b42a0b778b4612/html5/thumbnails/28.jpg)
Virtualization Oriented
■ No spinlocks in the kernel■ Simplest solution to lock holder preemption
■ No complicated hardware model■ Fair scheduler■ Huge pages■ Single address space: one set of page tables
![Page 29: Beating the Virtualization Tax for NoSQL Workloads with OSv](https://reader034.fdocuments.in/reader034/viewer/2022052523/555d63bad8b42a0b778b4612/html5/thumbnails/29.jpg)
So what about containers?
![Page 30: Beating the Virtualization Tax for NoSQL Workloads with OSv](https://reader034.fdocuments.in/reader034/viewer/2022052523/555d63bad8b42a0b778b4612/html5/thumbnails/30.jpg)
■ Docker is awesome! Low overhead!■ Small artifacts■ Fast deployment■ Fast startup (container start, not OS boot)
■ Docker is awesome! Easy builds!■ Simple configuration file■ Minimal additional work on top of application build
Docker is awesome
![Page 31: Beating the Virtualization Tax for NoSQL Workloads with OSv](https://reader034.fdocuments.in/reader034/viewer/2022052523/555d63bad8b42a0b778b4612/html5/thumbnails/31.jpg)
Hypervisors are awesome, too
■ Live migration (load balance, hardware maint)■ Multiple kernel versions available■ Running VMs everywhere is awesome!
■ Public cloud, private cloud, existing hypervisor...■ Security is awesome!
■ Container attack surface is full kernel interface.■ Hypervisor attack surface is small.
![Page 32: Beating the Virtualization Tax for NoSQL Workloads with OSv](https://reader034.fdocuments.in/reader034/viewer/2022052523/555d63bad8b42a0b778b4612/html5/thumbnails/32.jpg)
■ Fast boot, fast provisioning■ High performance■ Tiny footprint■ Virtualized
■ Live migration■ Elasticity■ MMU access
Everything is awesome
![Page 33: Beating the Virtualization Tax for NoSQL Workloads with OSv](https://reader034.fdocuments.in/reader034/viewer/2022052523/555d63bad8b42a0b778b4612/html5/thumbnails/33.jpg)
Different customization levels
● JVM-based application○ No effort
● Traditional C/C++ application○ More effort
● Virtio-app○ NFV - highest gain
![Page 34: Beating the Virtualization Tax for NoSQL Workloads with OSv](https://reader034.fdocuments.in/reader034/viewer/2022052523/555d63bad8b42a0b778b4612/html5/thumbnails/34.jpg)
C++ simplifies flow of control
![Page 35: Beating the Virtualization Tax for NoSQL Workloads with OSv](https://reader034.fdocuments.in/reader034/viewer/2022052523/555d63bad8b42a0b778b4612/html5/thumbnails/35.jpg)
Run existing applications
■ Open source, POSIX-compatible■ Run native Linux applications■ Run Java applications
![Page 36: Beating the Virtualization Tax for NoSQL Workloads with OSv](https://reader034.fdocuments.in/reader034/viewer/2022052523/555d63bad8b42a0b778b4612/html5/thumbnails/36.jpg)
Network channels: before
![Page 37: Beating the Virtualization Tax for NoSQL Workloads with OSv](https://reader034.fdocuments.in/reader034/viewer/2022052523/555d63bad8b42a0b778b4612/html5/thumbnails/37.jpg)
Network channels: after