SlideShare a Scribd company logo
1 of 20
Download to read offline
Andrey Vagin <avagin@openvz.org><
CRIU - Checkpoint/Restore in User-space
2
Agenda
● CRIU and use-cases
● History
● Current state
● Under the hood
● Kernel impact
● How to integrate with/into CRIU
● P.haul
● Questions
3
History
●
Berkeley Lab Checkpoint/Restart (BLCR) (2003)
– Load a kernel module and link with a library
●
DMTCP: Distributed MultiThreaded CheckPointing (2004-2006)
– Preload a library
●
OpenVZ (2005)
– OpenVZ kernel
●
Linux Checkpoint/Restart by Oren Laadan (2008)
– A non-mainline kernel
●
CRIU (2011)
OpenVZ
2005
BLCR
2003
Linux C/R
2008
CRIU
2011
DMTCP
2007
4
What is C/R and how can it be used?
C/R is the ability to save states of processes
and to restore them later.
Usage scenarios:
– Failure recovery
– Live migration
– RKU (seamless kernel update)
– Rollback to the previous state
– Speed up of slow-boot services
– HPC issues
5
Who is CRIU user?
6
How does this work?
Kernel objects Process tree
crtools
Image files
Name-spaces
Files
Sockets
Pipes
001101
101010
110001
011010
000011
010101
001101
101010
110001
011010
000011
010101
001101
101010
110001
011010
000011
010101
001101
101010
110001
011010
000011
010101
001101
101010
110001
011010
000011
010101
001101
101010
110001
011010
000011
010101
8
Dump
● Parasite code
– Receive file descriptors
– Dump memory content
– Prctl(), sigaction, pending signals, timers, etc.
● Ptrace
– freeze processes
– Inject a parasite code
● Netlink
– Get information about sockets, netns
● Procfs
/proc/PID/maps, /proc/PID/map_files/,
/proc/PID/status, /proc/PID/mountinfo
10
Restore
● Collect shared objects
● Restore name-spaces
● Create a process tree
– Restore SID, PGID
– Restore objects, which should be inherited
● Files, sockets, pipes, ...
● Restore per-task properties.
● Restore memory
● Sim! Sala bim!
● Awesome
Namespaces
Processes
11
sigreturn()
12
New features in a kernel
● Parasite code injection (by Tejun Heo)
– Read task states, that are currently retrieved by a task only about itself
● The kcmp() system call
– Helps checking which kernel objects are shared between processes
● Proc map_files directory
– Find out what exact file is mapped
– Mappings sharing info
● A bunch of prctl extensions
– Set various private stuff on task/mm objects (c/r-only feature)
● Last-pid sysctl
– Restore task with desired PID value
13
New features in a kernel
● Sockets information dumping via netlink (sock_diag)
– Extendable sockets state retrieving engine
● TCP repair mode
– Read intimate state of a TCP connection
and reconstructs it from scratch on a freshly created socket
● Virtual net devices indexes
– Allows to restore network devices in a namespace
● Socket peeking offset
– Allows peeking sockets queues (reading without removing data from queue)
● Task memory tracking
– incremental snapshots, online migration
14
How to integrate with CRIU
● Action scripts
– block/unblock network
– setup namespaces
– post-dump and post-restore
● RPC, shared library
● Plugins
15
RPC and libcriu.so
● Easy to use from other languages
– The protocol is based on protobuf messages
● Allow to use CRIU for unprivileged processes
– CRIU still requires root privileges to run
– UNIX domain sockets support passing credentials
● Self-dump
– A process can request to dump itself
16
Plugins
● Unknown file types
● External dependencies
– Unix sockets (dbus, journald, rsyslog, etc)
– Unknown character and block devices.
– External bind-mounts
– External net devices
– External something else
17
Community
18
In a Nutshell, CRIU...
.... has had 4,375 commits made by 36 contributors
representing 58,688 lines of code
... is mostly written in C
with a very low number of source code comments
... has a young, but established codebase
maintained by a large development team
with stable Y-O-Y commits
... estimated cost $ 787,432
https://www.ohloh.net/p/criu#
19
Where is CRIU now?
20
P.haul (process hauler) - Live migration using CRIU
Live migration using CRIU
● Iterative
● Optimal
● Customizable
#./p.haul ovz 100 10.30.25.213
Migration succeeded
total time is ~2.86 sec
frozen time is ~1.99 sec
( ['0.27', '0.18', '1.55'] )
restore time is ~0.86 sec
img sync time is ~0.32 sec
21
P.haul
Pre-dump and sync FS
Freeze, dump, sync FS
Restore
Kill
Resume
Post-dump
Resume
Post-resume
Thank you
http://criu.org

More Related Content

What's hot

Debugging with-wireshark-niels-de-vos
Debugging with-wireshark-niels-de-vosDebugging with-wireshark-niels-de-vos
Debugging with-wireshark-niels-de-vosGluster.org
 
Distributed Postgres
Distributed PostgresDistributed Postgres
Distributed PostgresStas Kelvich
 
Sdc 2012-challenges
Sdc 2012-challengesSdc 2012-challenges
Sdc 2012-challengesGluster.org
 
Time to rethink /proc
Time to rethink /procTime to rethink /proc
Time to rethink /procKir Kolyshkin
 
Introduction to netlink in linux kernel (english)
Introduction to netlink in linux kernel (english)Introduction to netlink in linux kernel (english)
Introduction to netlink in linux kernel (english)Sneeker Yeh
 
Gluster for sysadmins
Gluster for sysadminsGluster for sysadmins
Gluster for sysadminsGluster.org
 
Lt2013 glusterfs.talk
Lt2013 glusterfs.talkLt2013 glusterfs.talk
Lt2013 glusterfs.talkUdo Seidel
 
Kernel Proc Connector and Containers
Kernel Proc Connector and ContainersKernel Proc Connector and Containers
Kernel Proc Connector and ContainersKernel TLV
 
Checkpoint/restore of containers with CRIU
Checkpoint/restore of containers with CRIUCheckpoint/restore of containers with CRIU
Checkpoint/restore of containers with CRIUOpenVZ
 
Gluster intro-tdose
Gluster intro-tdoseGluster intro-tdose
Gluster intro-tdoseGluster.org
 
M|18 Architectural Overview: MariaDB MaxScale
M|18 Architectural Overview: MariaDB MaxScaleM|18 Architectural Overview: MariaDB MaxScale
M|18 Architectural Overview: MariaDB MaxScaleMariaDB plc
 
20160401 guster-roadmap
20160401 guster-roadmap20160401 guster-roadmap
20160401 guster-roadmapGluster.org
 
Lcna 2012-tutorial
Lcna 2012-tutorialLcna 2012-tutorial
Lcna 2012-tutorialGluster.org
 
Functional approach to packet processing
Functional approach to packet processingFunctional approach to packet processing
Functional approach to packet processingNicola Bonelli
 
FreeBSD and Drivers
FreeBSD and DriversFreeBSD and Drivers
FreeBSD and DriversKernel TLV
 

What's hot (17)

Debugging with-wireshark-niels-de-vos
Debugging with-wireshark-niels-de-vosDebugging with-wireshark-niels-de-vos
Debugging with-wireshark-niels-de-vos
 
Distributed Postgres
Distributed PostgresDistributed Postgres
Distributed Postgres
 
Sdc 2012-challenges
Sdc 2012-challengesSdc 2012-challenges
Sdc 2012-challenges
 
Time to rethink /proc
Time to rethink /procTime to rethink /proc
Time to rethink /proc
 
Introduction to netlink in linux kernel (english)
Introduction to netlink in linux kernel (english)Introduction to netlink in linux kernel (english)
Introduction to netlink in linux kernel (english)
 
Gluster for sysadmins
Gluster for sysadminsGluster for sysadmins
Gluster for sysadmins
 
Multimaster
MultimasterMultimaster
Multimaster
 
Lt2013 glusterfs.talk
Lt2013 glusterfs.talkLt2013 glusterfs.talk
Lt2013 glusterfs.talk
 
Kernel Proc Connector and Containers
Kernel Proc Connector and ContainersKernel Proc Connector and Containers
Kernel Proc Connector and Containers
 
Apache CouchDB
Apache CouchDBApache CouchDB
Apache CouchDB
 
Checkpoint/restore of containers with CRIU
Checkpoint/restore of containers with CRIUCheckpoint/restore of containers with CRIU
Checkpoint/restore of containers with CRIU
 
Gluster intro-tdose
Gluster intro-tdoseGluster intro-tdose
Gluster intro-tdose
 
M|18 Architectural Overview: MariaDB MaxScale
M|18 Architectural Overview: MariaDB MaxScaleM|18 Architectural Overview: MariaDB MaxScale
M|18 Architectural Overview: MariaDB MaxScale
 
20160401 guster-roadmap
20160401 guster-roadmap20160401 guster-roadmap
20160401 guster-roadmap
 
Lcna 2012-tutorial
Lcna 2012-tutorialLcna 2012-tutorial
Lcna 2012-tutorial
 
Functional approach to packet processing
Functional approach to packet processingFunctional approach to packet processing
Functional approach to packet processing
 
FreeBSD and Drivers
FreeBSD and DriversFreeBSD and Drivers
FreeBSD and Drivers
 

Similar to Андрей Вагин. Все что вы хотели знать о Criu, но стеснялись спросить...

FOSDEM 2015: Live migration for containers is around the corner
FOSDEM 2015: Live migration for containers is around the cornerFOSDEM 2015: Live migration for containers is around the corner
FOSDEM 2015: Live migration for containers is around the cornerOpenVZ
 
CRIU (Checkpoint and Restore In Userspace) FOSDEM 2015
CRIU (Checkpoint and Restore In Userspace) FOSDEM 2015CRIU (Checkpoint and Restore In Userspace) FOSDEM 2015
CRIU (Checkpoint and Restore In Userspace) FOSDEM 2015OpenVZ
 
FOSDEM2015: Live migration for containers is around the corner
FOSDEM2015: Live migration for containers is around the cornerFOSDEM2015: Live migration for containers is around the corner
FOSDEM2015: Live migration for containers is around the cornerAndrey Vagin
 
Kubernetes @ Squarespace (SRE Portland Meetup October 2017)
Kubernetes @ Squarespace (SRE Portland Meetup October 2017)Kubernetes @ Squarespace (SRE Portland Meetup October 2017)
Kubernetes @ Squarespace (SRE Portland Meetup October 2017)Kevin Lynch
 
LXC on Ganeti
LXC on GanetiLXC on Ganeti
LXC on Ganetikawamuray
 
Docker 原理與實作
Docker 原理與實作Docker 原理與實作
Docker 原理與實作kao kuo-tung
 
Fedora Virtualization Day: Linux Containers & CRIU
Fedora Virtualization Day: Linux Containers & CRIUFedora Virtualization Day: Linux Containers & CRIU
Fedora Virtualization Day: Linux Containers & CRIUAndrey Vagin
 
Moscow virtualization meetup 2014: CRIU 1.0 What is next?
Moscow virtualization meetup 2014: CRIU 1.0 What is next?Moscow virtualization meetup 2014: CRIU 1.0 What is next?
Moscow virtualization meetup 2014: CRIU 1.0 What is next?OpenVZ
 
The power of linux advanced tracer [POUG18]
The power of linux advanced tracer [POUG18]The power of linux advanced tracer [POUG18]
The power of linux advanced tracer [POUG18]Mahmoud Hatem
 
Ippevent : openshift Introduction
Ippevent : openshift IntroductionIppevent : openshift Introduction
Ippevent : openshift Introductionkanedafromparis
 
Containers and Namespaces in the Linux Kernel
Containers and Namespaces in the Linux KernelContainers and Namespaces in the Linux Kernel
Containers and Namespaces in the Linux KernelOpenVZ
 
Training Slides: Basics 104: Simple Tungsten Clustering Deployments
Training Slides: Basics 104: Simple Tungsten Clustering DeploymentsTraining Slides: Basics 104: Simple Tungsten Clustering Deployments
Training Slides: Basics 104: Simple Tungsten Clustering DeploymentsContinuent
 
Linux Kernel Memory Model
Linux Kernel Memory ModelLinux Kernel Memory Model
Linux Kernel Memory ModelSeongJae Park
 
Kubernetes @ Squarespace: Kubernetes in the Datacenter
Kubernetes @ Squarespace: Kubernetes in the DatacenterKubernetes @ Squarespace: Kubernetes in the Datacenter
Kubernetes @ Squarespace: Kubernetes in the DatacenterKevin Lynch
 
Training Slides: Intermediate 202: Performing Cluster Maintenance with Zero-D...
Training Slides: Intermediate 202: Performing Cluster Maintenance with Zero-D...Training Slides: Intermediate 202: Performing Cluster Maintenance with Zero-D...
Training Slides: Intermediate 202: Performing Cluster Maintenance with Zero-D...Continuent
 
Userspace RCU library : what linear multiprocessor scalability means for your...
Userspace RCU library : what linear multiprocessor scalability means for your...Userspace RCU library : what linear multiprocessor scalability means for your...
Userspace RCU library : what linear multiprocessor scalability means for your...Alexey Ivanov
 
7. Cloud Native Computing - Kubernetes - Bratislava - Rook.io
7. Cloud Native Computing - Kubernetes - Bratislava - Rook.io7. Cloud Native Computing - Kubernetes - Bratislava - Rook.io
7. Cloud Native Computing - Kubernetes - Bratislava - Rook.ioDávid Kőszeghy
 

Similar to Андрей Вагин. Все что вы хотели знать о Criu, но стеснялись спросить... (20)

FOSDEM 2015: Live migration for containers is around the corner
FOSDEM 2015: Live migration for containers is around the cornerFOSDEM 2015: Live migration for containers is around the corner
FOSDEM 2015: Live migration for containers is around the corner
 
CRIU (Checkpoint and Restore In Userspace) FOSDEM 2015
CRIU (Checkpoint and Restore In Userspace) FOSDEM 2015CRIU (Checkpoint and Restore In Userspace) FOSDEM 2015
CRIU (Checkpoint and Restore In Userspace) FOSDEM 2015
 
FOSDEM2015: Live migration for containers is around the corner
FOSDEM2015: Live migration for containers is around the cornerFOSDEM2015: Live migration for containers is around the corner
FOSDEM2015: Live migration for containers is around the corner
 
Kubernetes @ Squarespace (SRE Portland Meetup October 2017)
Kubernetes @ Squarespace (SRE Portland Meetup October 2017)Kubernetes @ Squarespace (SRE Portland Meetup October 2017)
Kubernetes @ Squarespace (SRE Portland Meetup October 2017)
 
LXC on Ganeti
LXC on GanetiLXC on Ganeti
LXC on Ganeti
 
Docker 原理與實作
Docker 原理與實作Docker 原理與實作
Docker 原理與實作
 
Fedora Virtualization Day: Linux Containers & CRIU
Fedora Virtualization Day: Linux Containers & CRIUFedora Virtualization Day: Linux Containers & CRIU
Fedora Virtualization Day: Linux Containers & CRIU
 
Moscow virtualization meetup 2014: CRIU 1.0 What is next?
Moscow virtualization meetup 2014: CRIU 1.0 What is next?Moscow virtualization meetup 2014: CRIU 1.0 What is next?
Moscow virtualization meetup 2014: CRIU 1.0 What is next?
 
Containers > VMs
Containers > VMsContainers > VMs
Containers > VMs
 
The power of linux advanced tracer [POUG18]
The power of linux advanced tracer [POUG18]The power of linux advanced tracer [POUG18]
The power of linux advanced tracer [POUG18]
 
Ippevent : openshift Introduction
Ippevent : openshift IntroductionIppevent : openshift Introduction
Ippevent : openshift Introduction
 
Containers and Namespaces in the Linux Kernel
Containers and Namespaces in the Linux KernelContainers and Namespaces in the Linux Kernel
Containers and Namespaces in the Linux Kernel
 
Training Slides: Basics 104: Simple Tungsten Clustering Deployments
Training Slides: Basics 104: Simple Tungsten Clustering DeploymentsTraining Slides: Basics 104: Simple Tungsten Clustering Deployments
Training Slides: Basics 104: Simple Tungsten Clustering Deployments
 
Linux Kernel Memory Model
Linux Kernel Memory ModelLinux Kernel Memory Model
Linux Kernel Memory Model
 
Kubernetes @ Squarespace: Kubernetes in the Datacenter
Kubernetes @ Squarespace: Kubernetes in the DatacenterKubernetes @ Squarespace: Kubernetes in the Datacenter
Kubernetes @ Squarespace: Kubernetes in the Datacenter
 
Training Slides: Intermediate 202: Performing Cluster Maintenance with Zero-D...
Training Slides: Intermediate 202: Performing Cluster Maintenance with Zero-D...Training Slides: Intermediate 202: Performing Cluster Maintenance with Zero-D...
Training Slides: Intermediate 202: Performing Cluster Maintenance with Zero-D...
 
Userspace RCU library : what linear multiprocessor scalability means for your...
Userspace RCU library : what linear multiprocessor scalability means for your...Userspace RCU library : what linear multiprocessor scalability means for your...
Userspace RCU library : what linear multiprocessor scalability means for your...
 
Cncf meetup-rook
Cncf meetup-rookCncf meetup-rook
Cncf meetup-rook
 
Cncf meetup-rook
Cncf meetup-rookCncf meetup-rook
Cncf meetup-rook
 
7. Cloud Native Computing - Kubernetes - Bratislava - Rook.io
7. Cloud Native Computing - Kubernetes - Bratislava - Rook.io7. Cloud Native Computing - Kubernetes - Bratislava - Rook.io
7. Cloud Native Computing - Kubernetes - Bratislava - Rook.io
 

More from WG_ Events

Интегрировать сторонний продукт или пилить самим? К вопросу о выборе системы ...
Интегрировать сторонний продукт или пилить самим? К вопросу о выборе системы ...Интегрировать сторонний продукт или пилить самим? К вопросу о выборе системы ...
Интегрировать сторонний продукт или пилить самим? К вопросу о выборе системы ...WG_ Events
 
Self Service BI. Как перейти от Excel к визуализации / Иван Климович для Data...
Self Service BI. Как перейти от Excel к визуализации / Иван Климович для Data...Self Service BI. Как перейти от Excel к визуализации / Иван Климович для Data...
Self Service BI. Как перейти от Excel к визуализации / Иван Климович для Data...WG_ Events
 
Оценка потенциала игрового продукта по косвенным признакам / Борис Cиницкий д...
Оценка потенциала игрового продукта по косвенным признакам / Борис Cиницкий д...Оценка потенциала игрового продукта по косвенным признакам / Борис Cиницкий д...
Оценка потенциала игрового продукта по косвенным признакам / Борис Cиницкий д...WG_ Events
 
​Конкурентный анализ. Учимся на чужих ошибках / Евгений Пальчевский для DataT...
​Конкурентный анализ. Учимся на чужих ошибках / Евгений Пальчевский для DataT...​Конкурентный анализ. Учимся на чужих ошибках / Евгений Пальчевский для DataT...
​Конкурентный анализ. Учимся на чужих ошибках / Евгений Пальчевский для DataT...WG_ Events
 
DataTalks #4: Построение хранилища данных на основе платформы hadoop / Игорь ...
DataTalks #4: Построение хранилища данных на основе платформы hadoop / Игорь ...DataTalks #4: Построение хранилища данных на основе платформы hadoop / Игорь ...
DataTalks #4: Построение хранилища данных на основе платформы hadoop / Игорь ...WG_ Events
 
DataTalks #4: Необходимый минимум инструментов для построения своей системы р...
DataTalks #4: Необходимый минимум инструментов для построения своей системы р...DataTalks #4: Необходимый минимум инструментов для построения своей системы р...
DataTalks #4: Необходимый минимум инструментов для построения своей системы р...WG_ Events
 
DataTalks #4: Как ответить на вопрос «Что будет?»: практические советы / Андр...
DataTalks #4: Как ответить на вопрос «Что будет?»: практические советы / Андр...DataTalks #4: Как ответить на вопрос «Что будет?»: практические советы / Андр...
DataTalks #4: Как ответить на вопрос «Что будет?»: практические советы / Андр...WG_ Events
 
DataTalks #4: Что такое предиктивная аналитика и кому она нужна / Надежда Руч...
DataTalks #4: Что такое предиктивная аналитика и кому она нужна / Надежда Руч...DataTalks #4: Что такое предиктивная аналитика и кому она нужна / Надежда Руч...
DataTalks #4: Что такое предиктивная аналитика и кому она нужна / Надежда Руч...WG_ Events
 
DataTalks #4: Использование предиктивной аналитики для управления ценностью к...
DataTalks #4: Использование предиктивной аналитики для управления ценностью к...DataTalks #4: Использование предиктивной аналитики для управления ценностью к...
DataTalks #4: Использование предиктивной аналитики для управления ценностью к...WG_ Events
 
Константин Гавриков - Люди, процесс и результат. Дизайн и корпорации - Wargaming
Константин Гавриков - Люди, процесс и результат. Дизайн и корпорации - WargamingКонстантин Гавриков - Люди, процесс и результат. Дизайн и корпорации - Wargaming
Константин Гавриков - Люди, процесс и результат. Дизайн и корпорации - WargamingWG_ Events
 
Олеся Плеханова - UX-дизайнер на работе и в жизни - Wargaming
Олеся Плеханова - UX-дизайнер на работе и в жизни - WargamingОлеся Плеханова - UX-дизайнер на работе и в жизни - Wargaming
Олеся Плеханова - UX-дизайнер на работе и в жизни - WargamingWG_ Events
 
Юрий Ветров - Продуктовый дизайнер. Современное понимание профессии - Mail.Ru...
Юрий Ветров - Продуктовый дизайнер. Современное понимание профессии - Mail.Ru...Юрий Ветров - Продуктовый дизайнер. Современное понимание профессии - Mail.Ru...
Юрий Ветров - Продуктовый дизайнер. Современное понимание профессии - Mail.Ru...WG_ Events
 
Роман Буй “Рандомный маркетинг или как мы выпускали World of Tanks Blitz” / W...
Роман Буй “Рандомный маркетинг или как мы выпускали World of Tanks Blitz” / W...Роман Буй “Рандомный маркетинг или как мы выпускали World of Tanks Blitz” / W...
Роман Буй “Рандомный маркетинг или как мы выпускали World of Tanks Blitz” / W...WG_ Events
 
Артем Глущеня "Про аркадки и людей" / Дизайнер-мультистаночник Happymagenta
Артем Глущеня "Про аркадки и людей" / Дизайнер-мультистаночник HappymagentaАртем Глущеня "Про аркадки и людей" / Дизайнер-мультистаночник Happymagenta
Артем Глущеня "Про аркадки и людей" / Дизайнер-мультистаночник HappymagentaWG_ Events
 
Даниил ‘Censored_ID’ Копытько “Расширенный текстуринг под мобильные устройств...
Даниил ‘Censored_ID’ Копытько “Расширенный текстуринг под мобильные устройств...Даниил ‘Censored_ID’ Копытько “Расширенный текстуринг под мобильные устройств...
Даниил ‘Censored_ID’ Копытько “Расширенный текстуринг под мобильные устройств...WG_ Events
 
Алексей Алексеев ”Blitz-доклад”/ Wargaming
Алексей Алексеев ”Blitz-доклад”/ WargamingАлексей Алексеев ”Blitz-доклад”/ Wargaming
Алексей Алексеев ”Blitz-доклад”/ WargamingWG_ Events
 
Михаил Фролов - Конверсия в социальных сетях и продажа эмоций - Fotostrana.ru
Михаил Фролов - Конверсия в социальных сетях и продажа эмоций - Fotostrana.ruМихаил Фролов - Конверсия в социальных сетях и продажа эмоций - Fotostrana.ru
Михаил Фролов - Конверсия в социальных сетях и продажа эмоций - Fotostrana.ruWG_ Events
 
Ольга Качалина - Mobile prototyping. fake it till you make it. - Wargaming
Ольга Качалина - Mobile prototyping. fake it till you make it. - WargamingОльга Качалина - Mobile prototyping. fake it till you make it. - Wargaming
Ольга Качалина - Mobile prototyping. fake it till you make it. - WargamingWG_ Events
 
Илья Трегубов - Борьба с привычками. Cтратегии редизайна - Wargaming
Илья Трегубов - Борьба с привычками. Cтратегии редизайна - WargamingИлья Трегубов - Борьба с привычками. Cтратегии редизайна - Wargaming
Илья Трегубов - Борьба с привычками. Cтратегии редизайна - WargamingWG_ Events
 
Гринчук Александр - Практическое применение Data mining технологий-ооо «нанот...
Гринчук Александр - Практическое применение Data mining технологий-ооо «нанот...Гринчук Александр - Практическое применение Data mining технологий-ооо «нанот...
Гринчук Александр - Практическое применение Data mining технологий-ооо «нанот...WG_ Events
 

More from WG_ Events (20)

Интегрировать сторонний продукт или пилить самим? К вопросу о выборе системы ...
Интегрировать сторонний продукт или пилить самим? К вопросу о выборе системы ...Интегрировать сторонний продукт или пилить самим? К вопросу о выборе системы ...
Интегрировать сторонний продукт или пилить самим? К вопросу о выборе системы ...
 
Self Service BI. Как перейти от Excel к визуализации / Иван Климович для Data...
Self Service BI. Как перейти от Excel к визуализации / Иван Климович для Data...Self Service BI. Как перейти от Excel к визуализации / Иван Климович для Data...
Self Service BI. Как перейти от Excel к визуализации / Иван Климович для Data...
 
Оценка потенциала игрового продукта по косвенным признакам / Борис Cиницкий д...
Оценка потенциала игрового продукта по косвенным признакам / Борис Cиницкий д...Оценка потенциала игрового продукта по косвенным признакам / Борис Cиницкий д...
Оценка потенциала игрового продукта по косвенным признакам / Борис Cиницкий д...
 
​Конкурентный анализ. Учимся на чужих ошибках / Евгений Пальчевский для DataT...
​Конкурентный анализ. Учимся на чужих ошибках / Евгений Пальчевский для DataT...​Конкурентный анализ. Учимся на чужих ошибках / Евгений Пальчевский для DataT...
​Конкурентный анализ. Учимся на чужих ошибках / Евгений Пальчевский для DataT...
 
DataTalks #4: Построение хранилища данных на основе платформы hadoop / Игорь ...
DataTalks #4: Построение хранилища данных на основе платформы hadoop / Игорь ...DataTalks #4: Построение хранилища данных на основе платформы hadoop / Игорь ...
DataTalks #4: Построение хранилища данных на основе платформы hadoop / Игорь ...
 
DataTalks #4: Необходимый минимум инструментов для построения своей системы р...
DataTalks #4: Необходимый минимум инструментов для построения своей системы р...DataTalks #4: Необходимый минимум инструментов для построения своей системы р...
DataTalks #4: Необходимый минимум инструментов для построения своей системы р...
 
DataTalks #4: Как ответить на вопрос «Что будет?»: практические советы / Андр...
DataTalks #4: Как ответить на вопрос «Что будет?»: практические советы / Андр...DataTalks #4: Как ответить на вопрос «Что будет?»: практические советы / Андр...
DataTalks #4: Как ответить на вопрос «Что будет?»: практические советы / Андр...
 
DataTalks #4: Что такое предиктивная аналитика и кому она нужна / Надежда Руч...
DataTalks #4: Что такое предиктивная аналитика и кому она нужна / Надежда Руч...DataTalks #4: Что такое предиктивная аналитика и кому она нужна / Надежда Руч...
DataTalks #4: Что такое предиктивная аналитика и кому она нужна / Надежда Руч...
 
DataTalks #4: Использование предиктивной аналитики для управления ценностью к...
DataTalks #4: Использование предиктивной аналитики для управления ценностью к...DataTalks #4: Использование предиктивной аналитики для управления ценностью к...
DataTalks #4: Использование предиктивной аналитики для управления ценностью к...
 
Константин Гавриков - Люди, процесс и результат. Дизайн и корпорации - Wargaming
Константин Гавриков - Люди, процесс и результат. Дизайн и корпорации - WargamingКонстантин Гавриков - Люди, процесс и результат. Дизайн и корпорации - Wargaming
Константин Гавриков - Люди, процесс и результат. Дизайн и корпорации - Wargaming
 
Олеся Плеханова - UX-дизайнер на работе и в жизни - Wargaming
Олеся Плеханова - UX-дизайнер на работе и в жизни - WargamingОлеся Плеханова - UX-дизайнер на работе и в жизни - Wargaming
Олеся Плеханова - UX-дизайнер на работе и в жизни - Wargaming
 
Юрий Ветров - Продуктовый дизайнер. Современное понимание профессии - Mail.Ru...
Юрий Ветров - Продуктовый дизайнер. Современное понимание профессии - Mail.Ru...Юрий Ветров - Продуктовый дизайнер. Современное понимание профессии - Mail.Ru...
Юрий Ветров - Продуктовый дизайнер. Современное понимание профессии - Mail.Ru...
 
Роман Буй “Рандомный маркетинг или как мы выпускали World of Tanks Blitz” / W...
Роман Буй “Рандомный маркетинг или как мы выпускали World of Tanks Blitz” / W...Роман Буй “Рандомный маркетинг или как мы выпускали World of Tanks Blitz” / W...
Роман Буй “Рандомный маркетинг или как мы выпускали World of Tanks Blitz” / W...
 
Артем Глущеня "Про аркадки и людей" / Дизайнер-мультистаночник Happymagenta
Артем Глущеня "Про аркадки и людей" / Дизайнер-мультистаночник HappymagentaАртем Глущеня "Про аркадки и людей" / Дизайнер-мультистаночник Happymagenta
Артем Глущеня "Про аркадки и людей" / Дизайнер-мультистаночник Happymagenta
 
Даниил ‘Censored_ID’ Копытько “Расширенный текстуринг под мобильные устройств...
Даниил ‘Censored_ID’ Копытько “Расширенный текстуринг под мобильные устройств...Даниил ‘Censored_ID’ Копытько “Расширенный текстуринг под мобильные устройств...
Даниил ‘Censored_ID’ Копытько “Расширенный текстуринг под мобильные устройств...
 
Алексей Алексеев ”Blitz-доклад”/ Wargaming
Алексей Алексеев ”Blitz-доклад”/ WargamingАлексей Алексеев ”Blitz-доклад”/ Wargaming
Алексей Алексеев ”Blitz-доклад”/ Wargaming
 
Михаил Фролов - Конверсия в социальных сетях и продажа эмоций - Fotostrana.ru
Михаил Фролов - Конверсия в социальных сетях и продажа эмоций - Fotostrana.ruМихаил Фролов - Конверсия в социальных сетях и продажа эмоций - Fotostrana.ru
Михаил Фролов - Конверсия в социальных сетях и продажа эмоций - Fotostrana.ru
 
Ольга Качалина - Mobile prototyping. fake it till you make it. - Wargaming
Ольга Качалина - Mobile prototyping. fake it till you make it. - WargamingОльга Качалина - Mobile prototyping. fake it till you make it. - Wargaming
Ольга Качалина - Mobile prototyping. fake it till you make it. - Wargaming
 
Илья Трегубов - Борьба с привычками. Cтратегии редизайна - Wargaming
Илья Трегубов - Борьба с привычками. Cтратегии редизайна - WargamingИлья Трегубов - Борьба с привычками. Cтратегии редизайна - Wargaming
Илья Трегубов - Борьба с привычками. Cтратегии редизайна - Wargaming
 
Гринчук Александр - Практическое применение Data mining технологий-ооо «нанот...
Гринчук Александр - Практическое применение Data mining технологий-ооо «нанот...Гринчук Александр - Практическое применение Data mining технологий-ооо «нанот...
Гринчук Александр - Практическое применение Data mining технологий-ооо «нанот...
 

Recently uploaded

Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 

Recently uploaded (20)

Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 

Андрей Вагин. Все что вы хотели знать о Criu, но стеснялись спросить...

  • 1. Andrey Vagin <avagin@openvz.org>< CRIU - Checkpoint/Restore in User-space
  • 2. 2 Agenda ● CRIU and use-cases ● History ● Current state ● Under the hood ● Kernel impact ● How to integrate with/into CRIU ● P.haul ● Questions
  • 3. 3 History ● Berkeley Lab Checkpoint/Restart (BLCR) (2003) – Load a kernel module and link with a library ● DMTCP: Distributed MultiThreaded CheckPointing (2004-2006) – Preload a library ● OpenVZ (2005) – OpenVZ kernel ● Linux Checkpoint/Restart by Oren Laadan (2008) – A non-mainline kernel ● CRIU (2011) OpenVZ 2005 BLCR 2003 Linux C/R 2008 CRIU 2011 DMTCP 2007
  • 4. 4 What is C/R and how can it be used? C/R is the ability to save states of processes and to restore them later. Usage scenarios: – Failure recovery – Live migration – RKU (seamless kernel update) – Rollback to the previous state – Speed up of slow-boot services – HPC issues
  • 6. 6 How does this work? Kernel objects Process tree crtools Image files Name-spaces Files Sockets Pipes 001101 101010 110001 011010 000011 010101 001101 101010 110001 011010 000011 010101 001101 101010 110001 011010 000011 010101 001101 101010 110001 011010 000011 010101 001101 101010 110001 011010 000011 010101 001101 101010 110001 011010 000011 010101
  • 7. 8 Dump ● Parasite code – Receive file descriptors – Dump memory content – Prctl(), sigaction, pending signals, timers, etc. ● Ptrace – freeze processes – Inject a parasite code ● Netlink – Get information about sockets, netns ● Procfs /proc/PID/maps, /proc/PID/map_files/, /proc/PID/status, /proc/PID/mountinfo
  • 8. 10 Restore ● Collect shared objects ● Restore name-spaces ● Create a process tree – Restore SID, PGID – Restore objects, which should be inherited ● Files, sockets, pipes, ... ● Restore per-task properties. ● Restore memory ● Sim! Sala bim! ● Awesome Namespaces Processes
  • 10. 12 New features in a kernel ● Parasite code injection (by Tejun Heo) – Read task states, that are currently retrieved by a task only about itself ● The kcmp() system call – Helps checking which kernel objects are shared between processes ● Proc map_files directory – Find out what exact file is mapped – Mappings sharing info ● A bunch of prctl extensions – Set various private stuff on task/mm objects (c/r-only feature) ● Last-pid sysctl – Restore task with desired PID value
  • 11. 13 New features in a kernel ● Sockets information dumping via netlink (sock_diag) – Extendable sockets state retrieving engine ● TCP repair mode – Read intimate state of a TCP connection and reconstructs it from scratch on a freshly created socket ● Virtual net devices indexes – Allows to restore network devices in a namespace ● Socket peeking offset – Allows peeking sockets queues (reading without removing data from queue) ● Task memory tracking – incremental snapshots, online migration
  • 12. 14 How to integrate with CRIU ● Action scripts – block/unblock network – setup namespaces – post-dump and post-restore ● RPC, shared library ● Plugins
  • 13. 15 RPC and libcriu.so ● Easy to use from other languages – The protocol is based on protobuf messages ● Allow to use CRIU for unprivileged processes – CRIU still requires root privileges to run – UNIX domain sockets support passing credentials ● Self-dump – A process can request to dump itself
  • 14. 16 Plugins ● Unknown file types ● External dependencies – Unix sockets (dbus, journald, rsyslog, etc) – Unknown character and block devices. – External bind-mounts – External net devices – External something else
  • 16. 18 In a Nutshell, CRIU... .... has had 4,375 commits made by 36 contributors representing 58,688 lines of code ... is mostly written in C with a very low number of source code comments ... has a young, but established codebase maintained by a large development team with stable Y-O-Y commits ... estimated cost $ 787,432 https://www.ohloh.net/p/criu#
  • 18. 20 P.haul (process hauler) - Live migration using CRIU Live migration using CRIU ● Iterative ● Optimal ● Customizable #./p.haul ovz 100 10.30.25.213 Migration succeeded total time is ~2.86 sec frozen time is ~1.99 sec ( ['0.27', '0.18', '1.55'] ) restore time is ~0.86 sec img sync time is ~0.32 sec
  • 19. 21 P.haul Pre-dump and sync FS Freeze, dump, sync FS Restore Kill Resume Post-dump Resume Post-resume