Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
CRIUをホスティングで試していく #hostingcasual / My CRIU Life...
Search
KONDO Uchio
March 22, 2019
Technology
0
420
CRIUをホスティングで試していく #hostingcasual / My CRIU Life in Progress
@ホスティングカジュアル #5
直近のイベント宣伝等を抜いています。
KONDO Uchio
March 22, 2019
Tweet
Share
More Decks by KONDO Uchio
See All by KONDO Uchio
大規模レガシーテストを 倒すための CI基盤の作り方 / #CICD2023
udzura
5
2.4k
Ruby x BPF in Action / RubyKaigi 2022
udzura
0
260
Narrative of Ruby & Rust
udzura
0
230
開発者生産性指標の可視化 / pepabo-four-keys
udzura
3
1.7k
Talk of RBS
udzura
0
450
Re: みなさん最近どうですか? / FGN tech meetup in 2021
udzura
0
790
Dockerとやわらかい仮想化 - ProSec-IT/SECKUN 2021 edition -
udzura
2
740
Device access filtering in cgroup v2
udzura
1
930
"Story of Rucy" on RubyKaigi takeout 2021
udzura
0
850
Other Decks in Technology
See All in Technology
イオン店舗一覧ページのパフォーマンスチューニング事例 / Performance tuning example for AEON store list page
aeonpeople
2
290
第4回 関東Kaggler会 [Training LLMs with Limited VRAM]
tascj
12
1.8k
ABEMAにおける 生成AI活用の現在地 / The Current Status of Generative AI at ABEMA
dekatotoro
0
660
つくって納得、つかって実感! 大規模言語モデルことはじめ
recruitengineers
PRO
24
6.2k
ECS モニタリング手法大整理
yendoooo
1
120
夢の印税生活 / Life on Royalties
tmtms
0
280
microCMS 最新リリース情報(microCMS Meetup 2025)
microcms
0
110
Goss: New Production-Ready Go Binding for Faiss #coefl_go_jp
bengo4com
0
1.1k
どこで動かすか、誰が動かすか 〜 kintoneのインフラ基盤刷新と運用体制のシフト 〜
ueokande
0
190
Yahoo!ニュースにおけるソフトウェア開発
lycorptech_jp
PRO
0
370
LLMエージェント時代に適応した開発フロー
hiragram
1
410
Gaze-LLE: Gaze Target Estimation via Large-Scale Learned Encoders
kzykmyzw
0
320
Featured
See All Featured
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
183
54k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
50k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
283
13k
Building Applications with DynamoDB
mza
96
6.6k
Optimising Largest Contentful Paint
csswizardry
37
3.4k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Visualization
eitanlees
147
16k
GraphQLとの向き合い方2022年版
quramy
49
14k
YesSQL, Process and Tooling at Scale
rocio
173
14k
Transcript
ϗεςΟϯάͰ$3*6Λ͓͏ ۙ౻Ӊஐ࿕(.01FQBCP *OD ϗεςΟϯάΧδϡΞϧ <)BDPOJXB$3*6ਐḿ><ݕࡧ>
γχΞɾϓϦϯγύϧΤϯδχΞ ۙ౻ Ӊஐ࿕ / @udzura https://blog.udzura.jp/ Uchio Kondo ٕज़෦ ٕज़ج൫νʔϜ
ίϯςφ
None
ϗεςΟϯάʹಋೖ
Web Proxy Web Request Dispatcher FastContainer Runtime CMDB ❌ FastContainer
Killed 1. Check 2. Boot 3. Forward 4. Terminate
ϦΫΤετ Ұఆ࣌ؒͷఀࢭ ఀࢭޙͷ࣍ͷϦΫΤετͰ Ұ͔Βىಈ OHY@NSVCZ $POUBJOFST ݱࡏͷڍಈ
࠶ىಈͷίετ
None
Memory dump Network conf File descriptors cgroup params ...... CRIU
Target process Syscalls, /proc files ... Kernel $3*6ͰΠϝʔδΛ࡞ɺ͔ͦ͜Βىಈ ˞ࢀߟ
ϦΫΤετ ఀࢭޙͷ࣍ͷϦΫΤετͰ $3*6Πϝʔδ͔Βىಈ OHY@NSVCZ $3*6ಋೖ ඇಉظͰ Πϝʔδͷ࠶࡞ $POUBJOFST $3*6JNBHF
ޮՌଌఆ
ڥ Ұ෦ Bench(Bastion) Compute(Users) Web Proxy Core API CMDB 8
Core 51GB Mem 1 Core 2GB Mem
ܭଌ݁Ռ
ܭଌ݁Ռ DPOUFOUSPPUFYU
ܭଌ݁Ռ
ܭଌ݁Ռ 3FTQPOTF5JNF NT ✴"QBDIF͕Ϩεϙϯε Λฦͨ࣌ؒ͠Λൺֱɻ ✴"QBDIFͯ͢ͷϫʔ Χʔ্ཱ͕͕ͪΔલʹ ϨεϙϯεΛฦͤΔ͜ ͱ͕ޙʹΘ͔ͬͨ
࣮
ϦετΞ͞ΕͨϓϩηεΛɺ )BDPOJXBͷԼʹ͍ͨ͠ɻ Haconiwa sv-sv \- criu restore \- Container Haconiwa
sv-sv \- Haconiwa sv \- Container ௨ৗىಈ CRIUܦ༝ͷىಈ ϑοΫॲཧ ओʹ͜͜Ͱߦ͏ ʁʁʁ
ํ๏ TXSLNPEF SFTUPSFTJCMJOH shd: vagrant@pts/0 \_ -bash \_ sudo
../mruby/bin/mruby example/restore_child.rb \_ ../mruby/bin/mruby example/restore_child.rb <- libcriuΛݺͼग़ͨ͠mruby script \_ /usr/local/apache2/bin/httpd -DFOREGROUND -X <- ͜Ε͕ίϯςφϓϩηε \_ /usr/local/sbin/criu swrk 6 <- ͜Ε͕swrkϞʔυͰ্ཱ͕ͪͬͨαʔϏεͰɺ cr_restore_tasks() ͜͜ͰಡΜͰ͍Δ \_ sh -c ps auxf <- ֬ೝͷͨΊʹ system() ͨ͠ͷ \_ ps auxf
$3*6ͷTXSLNPEF w·ͣTXSLϞʔυͷઆ໌Ͱ͕͢ɺ͜ΕMJCDSJVͰؔΛݺͼग़ͨ͠ࡍʹɺ ΞυϗοΫʹDSJVόΠφϦͦͷͷΛݺͼग़ͯ͠αʔϏεΛ࡞͠ɺݟ͔͚ ্αʔϏεͳ͠ͰDSJVͷػೳΛ͏ϞʔυͰ͢ʢਤ̎ࠨʣɻ
DMPOF $-0/&@1"3&/5 $ ./clone-tarou parent --use-clone-parent [!] Hey, maybe a
new sibling is added 26627 pts/1 S+ 0:00 \_ ./clone-tarou parent --use-clone-parent 26628 pts/1 S+ 0:00 \_ clone-tarou tarou --use-clone-parent 26629 pts/1 S+ 0:00 \_ clone-tarou jirou [!] exit: PID=26628 [!] exit: PID=26629 <DMPOFͷ$-0/&@1"3&/5ϑϥάͷڍಈΛ؍͢Δ><ݕࡧ>
clone(fun, ..., CLONE_PARENT|CLONE_NEWPID) ɺΧʔωϧͷόʔδϣϯʹΑͬͯ ಈ͔ͳ͍Β͍͠ $3*6ͷίϝϯτΑΓ
ํ๏ FYFDDNEͬͪ͜Λ࠾༻ Haconiwa sv \- criu restore \- Container
Haconiwa sv \- haconiwa _restored \- Container FYFD XBJU wDSJVίϚϯυͰϦετΞ͔ͯ͠ΒɺҙͷϓϩάϥϜʹFYFDWF Ͱ͖Δ wFYFDલʹGPSLͨ͠ϓϩηεΛɺ৽͍͠ϓϩάϥϜଆͰXBJU Ͱ͖Δ
&YUFSOBMCJOENPVOUରԠ /path/to/pivot_root `- / (bind-mount self) `- /etc -> /other/etc
`- /home/foo -> /other2/home `- /var/log -> /other3/log wSPPUGTͷ֎ଆʹ͋ΔϑΝΠϧγεςϜSPPUΛCJOENPVOUͯ͠ɺ DISPPUQJWPU@SPPU ͔ͯ͠Β͑ΔΑ͏ʹ͢Δ͜ͱ͕Α͋͘Δ™ wͦ͏͍͏֎ଆͷϑΝΠϧγεςϜΛ$3*6͕ཧղͰ͖ΔΑ͏ʹ͢Δ ͜͜ʹpivot_root
&YUFSOBMCJOENPVOU͕͏·͍͔͘Μ
Φϓγϣϯ͗͢ΜͶΜ
Ṗʹͭͳ͕Βͳ͍ωοτϫʔΫ
ωοτϫʔΫϩοΫ͕1"5)͕ͳ͍ͷͰ ղআ͞Εͳ͍ɻ
ͯ͠Δʁ Hotstart Start from CRIU
Web Proxy Web Request Dispatcher FastContainer Runtime CMDB ❌ FastContainer
Killed 1. Check 2. Boot 3. Forward 4. Terminate 'BTU3FNPUF$IFDLͱ͍͏ NHFNΛར༻͍ͯͬͯ͠Δ͕ɺ ઃఆ͕มʁ
'BTU3FNPUF$IFDLͷύϥϝʔλௐ
None
IUUQTHJUIVCDPNIBDPOJXBIBDPOJXBQVMMT RJT"QS JT"DMPTFE ͦͷ΄͔ wࡉʑͱࠔͬͨ͜ͱ͕͕͋ͬͨɺׂͱҰ௨ΓରԠͰ͖ͨؾ͕͢Δɻ wԼهࢀߟΣοϒϖʔδͰ͢
ࠓޙ
ϦϦʔεͰ͖ΔΑ͏ؤுΔͧʙ OPEB͞Μ͕
(SFOBEJOFͱ͍͏ͷΛ࡞ͬͨ
None