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
nameraka-hosting-lolipop-managed-cloud
Search
ry023
October 07, 2017
0
2.4k
nameraka-hosting-lolipop-managed-cloud
ry023
October 07, 2017
Tweet
Share
More Decks by ry023
See All by ry023
ロリポップ!マネージドクラウドをセットアップしてみよう!(ver.PHPカンファレンス福岡2019)
ry023
0
220
hoscon-golang-handson
ry023
2
1.2k
コンテナ母艦サーバが 突然停止しても障害にならない、 そうマネクラならね
ry023
1
370
ロリポップ!マネージドクラウド FastContainerの裏側
ry023
0
180
Featured
See All Featured
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.9k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
111
49k
It's Worth the Effort
3n
183
28k
Fashionably flexible responsive web design (full day workshop)
malarkey
405
66k
Writing Fast Ruby
sferik
628
61k
The Language of Interfaces
destraynor
154
24k
Into the Great Unknown - MozCon
thekraken
33
1.5k
Visualization
eitanlees
146
15k
Optimising Largest Contentful Paint
csswizardry
33
3k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Transcript
ాதྒհ(.01FQBCP *OD ϗεςΟϯάΛͳΊΒ͔ʹ͍ͨ͠ dϩϦϙοϓʂϚωʔδυΫϥυd
ΤϯδχΞ ాதྒհ!SZ@ ϗεςΟϯάࣄۀ෦ΠϯϑϥνʔϜ ݄۽ຊେֶେֶӃใిؾిࢠֶઐ߈मྃ ಉ݄(.0ϖύϘʹ৽ଔΤϯδχΞͱͯ͠ೖࣾ ݄͔ΒΠϯϑϥνʔϜଐ ݄͔ΒϚωʔδυΫϥυ։ൃʹδϣΠϯ
ϖύϘͷϗεςΟϯάαʔϏε
Πϯϑϥଐ͞Εͯ·ͣ ϩϦϙοϓʂͷӡ༻Λݟͯͨ
Ұൠతͳ8FCϗεςΟϯάͰʜ wϢʔβͷίϯςϯπɾϓϩηε͕ಛఆͷαʔόʹඥͮ͘ wෛՙࢄͷ͠͞ʜ wٸͳΞΫηε૿ͷεέʔϧͷ͠͞ʜ wଞαʔόͷҠߦͷ͠͞ʜ wݱঢ়ͷϩϦϙοϓʂ
ྫ͑ʜ
ྫ͑ʜ ʮ͜ͷαʔόॏ͍͔Β ɹผͷαʔόʹҠ͍ͬͯͩ͘͞ʜʯ Ҡઃͷఔௐʜ
͜ͷΜ͕ͳΊΒ͔ʹͳΕ ͍͍ͷʹͳ͊
ϩϦϙοϓʂͷ৽ϓϥϯ Ћςετ࣮ࢪதʂ
ϩϦϙοϓʂϚωʔδυΫϥυ wϩϦϙͷϓϥϯͷҰ͕ͭͩɺόοΫΤϯυɾϑϩϯτΤϯυڞʹҰ৽ wίϯςφܕϗεςΟϯάαʔϏε w'BTU$POUBJOFSΞʔΩςΫνϟΛ࠾༻ wίϯςφΤϯδϯʹIBDPOJXB
ϩϦϙοϓʂϚωʔδυΫϥυ ΦʔτεέʔϧͰ ٸͳΞΫηεʹରԠ ࣗಈͰ࠷৽ͷ ηΩϡϦςΟ ༷ʑͳ8FCΞϓϦΛ ͙͢ʹ։࢝
Φʔτεέʔϧ ΞΫηε͕૿͑Δͱ ෳͷίϯςφͰΞΫηεΛड͚Δ ΦʔτεέʔϧΛ༗ޮʹ
ϚωΫϥͲ͏ಈ͍͍ͯΔͷʁ Ͳ͏͍͏ϝϦοτ͕ʁ
'BTU$POUBJOFS
'BTU$POUBJOFSͱʁɹͬ͘͟Γ֓ཁ wฐࣾ!NBUVNPUPSZ͕ఏҊ w'BTU$(*ͷίϯςφ൛ͱ͍ͬͨΠϝʔδ w'BTU$(*$(*ͷϓϩηεΛऴྃͤͣʹ͍ճ͢ wϦΫΤετܖػͰ8FCΞϓϦͷίϯςφ͕ىಈ wҰىಈͨ͠ίϯςφͦͷޙ͍ճ͢ wҰఆ࣌ؒܦա͢ΔͱࣗΒఀࢭ͢Δ
'BTU$POUBJOFSͷྑ͞ wϢʔβ͔ΒݟΔͱʜ wΦʔτεέʔϧ w৭ΜͳίϯςφΛ༻ҙ͢Δ͜ͱͰ৭ʑͳΞϓϦΛఏڙ wੜ·ΕΘΓଓ͚ΔͷͰৗʹ࠷৽ wӡ༻͔ΒݟΔͱʜ wෛՙࢄɾଞϗετͷίϯςφࡌͤସ͑؆୯ wϦΫΤετ͕ͳ͍ͱίϯςφఀࢭ͢ΔͷͰϦιʔεͷઅ
ϩϦϙͷߏΛ௨ͯ͠ 'BTU$POUBJOFSΛݟ͍͖ͯ·͢
ϚωʔδυΫϥυશମߏ
DPNQVUF $.%# $PSF"1* -# $MJFOU EBUBQPPM DPOUBJOFS DPNQVUF OGT OGT
DPOUBJOFS DPOUBJOFS TUBUVTFOBCMFE IPTUDPNQVUF DPOUBJOFS TUBUVTFOBCMFE IPTUDPNQVUF ίϯςφͷใ 8FCQSPYZ ࣮ࡍίϯςφ͕ىಈ͢Δϗετ ίϯςφͷใΛཧˠ 'BTU$POUBJOFSؔ࿈ͷߏ Ϣʔβͷ ίϯςϯπ WBSXXXԼ
OHY@NSVCZ wฐࣾ!NBUTVNPUPSZ։ൃOHJOY֦ு NPE@NSVCZ͋Γ·͢ w/HJOYͷ֤ΠϕϯτʹIPPLͯ͠NSVCZΛ࣮ߦͰ͖Δ wϩϦϙʂϚωʔδυΫϥυͰϓϩΩγ࣌ʹ$PSF"1*ʹ͍߹Θͤ ͨΓɺIBDPOJXBΛ࣮ߦͨ͠Γ͢Δͷʹ׆༻ location / {
... mruby_set $backend /var/lib/mruby/hook.rb cache; # script࣮ߦ proxy_pass http://$backend:80; }
IBDPOJXB wฐࣾ!VE[VSB։ൃίϯςφΤϯδϯ wNSVCZͷ%4-Ͱઃఆ IBDPpMF Λهड़Մೳ wίϯςφͷϦιʔε੍ݶ DHSPVQʹΑΔ੍ݶ Haconiwa.define do |config|
config.chroot_to Pathname.new("/var/lib/haconiwa/rootfs/php") ... config.cgroup["cpu.cfs_period_us"] = 1000000 # cpu༻Λ੍ݶ(20%) config.cgroup["cpu.cfs_quota_us"] = 200000 # config.cgroup["pids.max"] = 128 # ϓϩηεΛ੍ݶ end
ϦΫΤετ͕དྷͨΒ
DPNQVUF $.%# $PSF"1* -# $MJFOU EBUBQPPM DPNQVUF OGT OGT DPOUBJOFS
TUBUVTSFBEZ IPTUDPNQVUF ίϯςφͷใ 8FCQSPYZ ϓϩδΣΫτ։࢝ޙ SFBEZػத
DPNQVUF $.%# $PSF"1* -# $MJFOU EBUBQPPM DPNQVUF OGT OGT DPOUBJOFS
TUBUVTFOBCMFE IPTUDPNQVUF ίϯςφͷใ 8FCQSPYZ ΞΫηεܖػͰίϯςφىಈ DPOUBJOFS
DPNQVUF $.%# $PSF"1* -# $MJFOU EBUBQPPM DPNQVUF OGT OGT DPOUBJOFS
TUBUVTFOBCMFE IPTUDPNQVUF ίϯςφͷใ 8FCQSPYZ ճҎ߱ߴ DPOUBJOFS ճҎ߱ͷϦΫΤετ ίϯςφىಈࡁΈͳͷͰߴ
ίϯςφͷࢮ
ίϯςφͷण໋ wίϯςφʹ-JGFUJNF͕ઃఆ͞Ε͓ͯΓɺҰఆ࣌ؒܦաͰࣗಈఀࢭ wIBDPOJXBͷIPPLͰίϯςφͷϓϩηεΛ,*-- wར༻தͷίϯςφ͕ఀࢭ͢ΔࡍίϯςφΛػதͱͯ͠ొ͢͠ w࣍ͷϦΫΤετͰ·ͨ৽͍͠ίϯςφ͕ىಈ͢Δ
DPNQVUF $.%# $PSF"1* EBUBQPPM DPNQVUF OGT OGT DPOUBJOFS TUBUVTFOBCMFE IPTUDPNQVUF
ίϯςφͷใ ίϯςφͷण໋ ʘण໋͖ͨʗ DPOUBJOFS
DPNQVUF $.%# $PSF"1* EBUBQPPM DPNQVUF OGT OGT DPOUBJOFS TUBUVTSFBEZ IPTUDPNQVUF
ίϯςφͷใ ίϯςφͷण໋ ػத SFBEZ ίϯςφΛ࠶ొ )"-5
DPNQVUF $.%# $PSF"1* EBUBQPPM DPNQVUF OGT OGT DPOUBJOFS TUBUVTFOBCMFE IPTUDPNQVUF
ίϯςφͷใ ίϯςφͷण໋ -# $MJFOU 8FCQSPYZ ϦΫΤετܖػͰ ৽͍͠ίϯςφىಈ DPOUBJOFS
ίϯςφʹण໋͕͋Δ͜ͱͰʜ wϦΫΤετ͕ͳ͍ίϯςφউखʹఀࢭ͠ɺϦιʔεΛ৯ΘͣΤίʂ wఆظతʹίϯςφ͕৽͘͠ੜ·ΕมΘΔ w৽͘͠ͳΔλΠϛϯάͰϥΠϒϥϦߋ৽͞ΕηΩϡΞ wίϯςφΛผϗετʹҠߦ͍ͨ࣌͠$.%#Λ͍͡Δ͚ͩͰ0, wίϯςφ໌ࣔతʹఀࢭͤͣ͞ͱউखʹࢮ͵ wDPNQVUF ίϯςφͷ؋ ͷϝϯς͍ͨ࣌͠؆୯
DPNQVUF $.%# $PSF"1* EBUBQPPM DPNQVUF OGT OGT DPOUBJOFS TUBUVTFOBCMFE IPTUDPNQVUF
ίϯςφͷใ ϗετࡌͤସ͚͑ͨ͠Εʜ -# $MJFOU 8FCQSPYZ DPOUBJOFS
DPNQVUF $.%# $PSF"1* EBUBQPPM DPNQVUF OGT OGT DPOUBJOFS TUBUVTFOBCMFE IPTUDPNQVUF
ίϯςφͷใ ϗετࡌͤସ͚͑ͨ͠Εʜ -# $MJFOU 8FCQSPYZ DPOUBJOFS DPOUBJOFS ˡϗετΛมߋ
DPNQVUF $.%# $PSF"1* EBUBQPPM DPNQVUF OGT OGT DPOUBJOFS TUBUVTFOBCMFE IPTUDPNQVUF
ίϯςφͷใ ϗετࡌͤସ͚͑ͨ͠Εʜ -# $MJFOU 8FCQSPYZ DPOUBJOFS ˡϗετΛมߋ ϝϯςφϯε
Φʔτεέʔϧ
Φʔτεέʔϧ wίϯςφͷෛՙʹԠͯ͡ɺίϯςφΛ૿ݮ wݱঢ়IBDPOJXBͰDHSPVQ͔ΒDQVෛՙΛଌఆ wϢʔβίϯςφͷ༧ΛઃఆՄೳ wίϯςφ͕Կ·Ͱىಈ͢Δ͔ɺͦΕͧΕͷίϯςφͰϦιʔεΛ ͲΕ͙Β͍͏͔ͳͲࣄલʹܾఆ͓ͯ͘͠ w$.%#Λ͍͡Δ͚ͩͰ0,
DPNQVUF $.%# $PSF"1* EBUBQPPM DPNQVUF OGT OGT DPOUBJOFS TUBUVTFOBCMFE IPTUDPNQVUF
ίϯςφͷใ εέʔϧΞτ DPOUBJOFS DPOUBJOFS TUBUVTEJTBCMFE IPTUDPNQVUF ༧Λొ
DPNQVUF $.%# $PSF"1* EBUBQPPM DPNQVUF OGT OGT DPOUBJOFS TUBUVTFOBCMFE IPTUDPNQVUF
ίϯςφͷใ εέʔϧΞτ DPOUBJOFS DPOUBJOFS TUBUVTEJTBCMFE IPTUDPNQVUF ༧Λొ ʘෛՙ͍ʗ ίϯςφ૿ͯ͠ʂ
DPNQVUF $.%# $PSF"1* EBUBQPPM DPNQVUF OGT OGT DPOUBJOFS TUBUVTFOBCMFE IPTUDPNQVUF
ίϯςφͷใ εέʔϧΞτ DPOUBJOFS ػίϯςφʹ มߋ DPOUBJOFS TUBUVTSFBEZ IPTUDPNQVUF -# $MJFOU 8FCQSPYZ ϦΫΤετܖػͰ ৽͍͠ίϯςφىಈ DPOUBJOFS
DPNQVUF $.%# $PSF"1* EBUBQPPM DPNQVUF OGT OGT DPOUBJOFS TUBUVTFOBCMFE IPTUDPNQVUF
ίϯςφͷใ εέʔϧΠϯ DPOUBJOFS DPOUBJOFS TUBUVTSFBEZ IPTUDPNQVUF DPOUBJOFS ʘ͞΄ͲͰͳ͍ʗ ίϯςφݮΒͯ͠ʂ
DPNQVUF $.%# $PSF"1* EBUBQPPM DPNQVUF OGT OGT DPOUBJOFS TUBUVTFOBCMFE IPTUDPNQVUF
ίϯςφͷใ εέʔϧΠϯ DPOUBJOFS DPOUBJOFS ʘ͞΄ͲͰͳ͍ʗ ίϯςφݮΒͯ͠ʂ DPOUBJOFS TUBUVTEJTBCMFE IPTUDPNQVUF ࠶ͼEJTBCMFE
DPNQVUF $.%# $PSF"1* EBUBQPPM DPNQVUF OGT OGT DPOUBJOFS TUBUVTFOBCMFE IPTUDPNQVUF
ίϯςφͷใ εέʔϧΠϯ DPOUBJOFS DPOUBJOFS DPOUBJOFS TUBUVTEJTBCMFE IPTUDPNQVUF -# $MJFOU 8FCQSPYZ DPOUBJOFSʹ ϧʔςΟϯά͞Εͳ͍
DPNQVUF $.%# $PSF"1* EBUBQPPM DPNQVUF OGT OGT DPOUBJOFS TUBUVTFOBCMFE IPTUDPNQVUF
ίϯςφͷใ εέʔϧΠϯ DPOUBJOFS DPOUBJOFS DPOUBJOFS TUBUVTEJTBCMFE IPTUDPNQVUF -# $MJFOU 8FCQSPYZ DPOUBJOFSʹ ϧʔςΟϯά͞Εͳ͍ ͜Ε์͓͚ͬͯ উखʹఀࢭ͢Δ
%#্ʹ༧ΛͱΔ͚ͩͰ Φʔτεέʔϧ
·ͱΊ wϢʔβ͔ΒݟΔͱʜ wΦʔτεέʔϧ w৭ΜͳίϯςφΛ༻ҙ͢Δ͜ͱͰ৭ʑͳΞϓϦΛఏڙ wੜ·ΕΘΓଓ͚ΔͷͰৗʹ࠷৽ wӡ༻͔ΒݟΔͱʜ wෛՙࢄɾଞϗετͷίϯςφࡌͤସ͑؆୯ wϦΫΤετ͕ͳ͍ͱίϯςφఀࢭ͢ΔͷͰϦιʔεͷઅ
ࠓޙʹ͍ͭͯ wΦʔτεέʔϧʹؔ͢Δίϯςφͷෛՙܭଌͷํ๏มΘΓͦ͏ wࠓIBDPOJXBͰෛՙΛܭଌͯ͠ਃࠂ w1SPNFUIFVT D"EWJTPSͳͲͰͷίϯςφܭଌ wରԠΞϓϦέʔγϣϯΛ૿͢ʂ wίϯςφಉ࢜ͷ࿈ܞͳͲಋೖ
ੵۃత࠾༻தʂ ࠷৽ͷ࠾༻ใΛνΣοΫˠ !QC@SFDSVJU
͝੩ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠