criu: time and space travel service for linux applications · 2017. 12. 14. · criu: time and...
TRANSCRIPT
CRIU:Time and Space Travel Servicefor Linux Applications
Pavel EmelyanovLinuxCon NA, New Orleans, 2013
2
Agenda
What is CRIU?
Project history and state
Usage scenarios Live migration
Reboot-less kernel upgrade
Slow services startup
Advanced debugging and testing
and more...
3
What is CRIU?
Checkpoint Restore In Userspace
Checkpointor
Dump
Restoreor
Restart
Fullinfo
aboutstate
4
Why in userspace?
Kernel
User-space
Dump:- Ptrace- /proc- netlink- syscalls
Restore:- syscalls
Process
kmod
C/R API
5
CRIU background
Project started ~2 years ago
– an RFC on kernel memory API extension
– small command line tool
– minimal dump of process' internals
First release
– 23 Jul 2012
– x86 and basic stuff
Since then
– 150+ kernel patches merged
– new APIs for reading and setting process' state
6
Current project state
The latest release
– v0.7
– supports x86 & ARM
– stuff typical applications use
Explicitly checked
– Apache, nginx, Oracle*, mysql, mongodb
– Ssh/sshd, openvpn*, cron, sendmail
– Java, gcc, make
– VNC + { gimp, mplayer, blender, supertux }
– Screen + { bash, top, tcpdump, tar/bz2 }
* some kernel tweaks required
7
Usage scenarios
Live migration
– Useful in cluster
Kernel upgrade w/o reboot
Slow services startup
Periodic snapshots
– HPC case
Advanced debugging and testing
8
Live migration
Host A Host B
9
Live migration ++
Host A Host B
Shared FS
Pre-migrate memory
with memory tracker
10
Load balancing on cluster
Host A
Host C
Host B
11
Node maintenance
Host A Host B
12
Kernel upgrade w/o reboot
Host
Kernel A
KexecKernel B
13
Slow services startup
time# service foo start
Service readiness
Spawn process
Load config
Topup caches
Initialize resource pools
Ready
T
100%
14
Slow services startup
time
Tt < T
Ready
Spawn process
100%
Service readiness
# service foo start
15
Periodic snapshots
time
Memory tracker helpsto keep images smaller
16
HPC
time
Powerfailure
0% 20% 40% 60% 60%
17
Advanced debugging
Production Host
Applicationin trouble
Developer Host
Debugger
18
Advanced testing
Start App
T ~ 30 sec
t ~ 0.1 sec
...
...
t ~ 0.1 sec
19
Advanced testing
...
New testor
new hardware ?
20
More (funny) usecases
Forgot to launch your program in screen
– Live-migrate it there
Playing a game without the save button
– Snapshot it
Suspend-to-RAM a VDI session
21
CRIU project resources
http://criu.org – project news and documentation
http://git.criu.org – git repo with tool sources
+CRIU page
[email protected] mailing list
[email protected] is me
Thank you!