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
How to Continuously Upgrade Web Services Writte...
Search
Kentaro Kuribayashi
September 14, 2013
Technology
13
7.7k
How to Continuously Upgrade Web Services Written in PHP
PHP Conference 2013 #phpconf2013
Kentaro Kuribayashi
September 14, 2013
Tweet
Share
More Decks by Kentaro Kuribayashi
See All by Kentaro Kuribayashi
Bidirectional Quadratic Voting Leveraging Issue-Based Matching
kentaro
2
300
大高生へのメッセージ(令和6年度「大高未来塾」) / Messages to Current Students
kentaro
0
220
「始め方」の始め方 / How to Start Starting Things
kentaro
5
820
Dynamic IoT Applications and Isomorphic IoT Systems Using WebAssembly
kentaro
1
1.2k
わたしがこのところハマっている「ライセンスフリー無線」のご紹介 / An Invitation to License-Free Radio
kentaro
1
460
先行きの見えなさを楽しさに変える ーVUCA時代のキャリア論と絶対他力主義ー / How to develop your career in the VUCA era
kentaro
7
4.9k
組織の生産性を高める意思決定の構造と方法 / How to do make decision rapidly and effectively
kentaro
39
22k
キャリアを時間・空間軸で考える / Thinking about your career from both time and space viewpoints
kentaro
15
16k
WEB+DB PRESSで特集記事を書く方法 / How to Become an Author of WEB+DB PRESS
kentaro
7
1.4k
Other Decks in Technology
See All in Technology
[FOSS4G 2019 Niigata] AIによる効率的危険斜面抽出システムの開発について
nssv
0
310
TanStack Routerに移行するのかい しないのかい、どっちなんだい! / Are you going to migrate to TanStack Router or not? Which one is it?
kaminashi
0
580
The Rise of LLMOps
asei
5
1.2k
インフラとバックエンドとフロントエンドをくまなく調べて遅いアプリを早くした件
tubone24
1
430
強いチームと開発生産性
onk
PRO
33
11k
New Relicを活用したSREの最初のステップ / NRUG OKINAWA VOL.3
isaoshimizu
2
580
IBC 2024 動画技術関連レポート / IBC 2024 Report
cyberagentdevelopers
PRO
0
110
Making your applications cross-environment - OSCG 2024 NA
salaboy
0
180
個人でもIAM Identity Centerを使おう!(アクセス管理編)
ryder472
3
190
The Role of Developer Relations in AI Product Success.
giftojabu1
0
120
Lambdaと地方とコミュニティ
miu_crescent
2
370
これまでの計測・開発・デプロイ方法全部見せます! / Findy ISUCON 2024-11-14
tohutohu
3
360
Featured
See All Featured
Raft: Consensus for Rubyists
vanstee
136
6.6k
Optimising Largest Contentful Paint
csswizardry
33
2.9k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
Building Your Own Lightsaber
phodgson
103
6.1k
Designing for Performance
lara
604
68k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
16
2.1k
Designing Experiences People Love
moore
138
23k
Practical Orchestrator
shlominoach
186
10k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
44
2.2k
Imperfection Machines: The Place of Print at Facebook
scottboms
265
13k
A Tale of Four Properties
chriscoyier
156
23k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.7k
Transcript
PHPΞϓϦέʔγϣϯͷ ܧଓతόʔδϣϯΞοϓ @kentaro
@kentaro Rubyist / Perl Monger Vimmer (Vimྺ6 Kentaro Kuribayashi paperboy&co.
ٕज़ج൫νʔϜ
ͪɾͪͺʔ ͱ͍͏ݴ༿ͷ࢝ऀ
None
None
None
େม͓ੈʹͳ͓ͬͯΓ·͢
શࣾతٕज़ج൫ ͷඋ ৽ٕज़ͱ͔ ։ൃϓϩηεͷ վળ εΫϥϜͱ͔ طଘαʔϏεͷ վળ
શࣾతٕज़ج൫ ͷඋ ৽ٕज़ͱ͔ ։ൃϓϩηεͷ վળ εΫϥϜͱ͔ طଘαʔϏεͷ վળ
ͱ͜ΖͰ
http://php.net/archive/2013.php#id2013-07-11-1
དྷ(2014)ʹऴྃ
Ͳ͏͢Δʁ
มԽʹରԠ͢Δ
ڥมԽ͢Δ ࣌ڥͷมԽ ϏδωεڥͷมԽ ৫తڥͷมԽ ٕज़తڥͷมԽ
OSSมԽ͢Δ PHPൃల͍ͯ͘͠ 5.5.3←ΠϚίί ͍ΖΜͳػೳ ηΩϡϦςΟϑΟοΫε
OSSͷίετ ιϑτΣΞͷඅ༻ແྉ ಋೖɾӡ༻ʹؔ͢Δඅ༻ͦ ΕͳΓʹ͔͔Δ ಛʹӡ༻ʹؔͯ͠ όʔδϣϯΞοϓ
ΤίγεςϜ PHPΛߏ͢Δͷݴޠͦͷ ͷ͚ͩͰͳ͍ ίϛϡχςΟͰͷؔੑɺ ͦΕΒ͕ੜΈग़͢ϥΠϒϥ ϦɺυΩϡϝϯτ
5.3.2 ӽ͑ΒΕͳ͍น 5.2
ศརπʔϧ ͍Ζ͍ΖͳϥΠϒϥϦɺศར πʔϧ composer newrelic etc. 5.3Ҏલແࢹͷ
์ஔ͢Δͱʜ ݹ͍ॻ͖ํʹͻ͖ͣΒΕΔ ηΩϡϦςΟతʹϠό͍
։ൃεϐʔυ↓↓ ศརϥΠϒϥϦɾπʔϧ͕ ͑ͳ͍ ϨΨγʔίʔυͷ૿Ճ ·͢·͢εϐʔυ͕Լ ΠϊϕʔγϣϯͷδϨϯϚ
ͦͷ͋ͨΓͷ͜ͱ શ෦͜͜ʹॻ͔ Ε͍ͯ·͢ ඞಡ
WebαʔϏεͷ ܧଓతվળ
όʔδϣϯΞοϓ ίʔυΛมߋ͢Δ͚ͩͳΒͦ Μͳʹ͘͠ͳ͍ Ұ͚ͩΔʹɺ࣌ؒΛ ͔͚ΕͳΜͱ͔ͳΔ ͔࣮͠͠ࡍʹɺԿܧଓ తʹߋ৽͠ͳ͚ΕͳΒͳ͍
WebαʔϏεͷ໋॓ ڥৗʹมԽ͠ଓ͚Δ ͍·5.4, 5.5Ͱɺ͍ͣΕό ʔδϣϯΞοϓ͠ͳ͚Εͳ Βͳ͍ มԽʹରԠ͠ଓ͚Δඞཁ
ඞཁͳͷ αʔόͷߏཧ PHPϥΠϒϥϦͷཧ แׅతͳςετ ࣗಈσϓϩΠڥ ϞχλϦϯάͷΈ
ඞཁͳͷ αʔόͷߏཧ PHPϥΠϒϥϦͷཧ แׅతͳςετ ࣗಈσϓϩΠڥ ϞχλϦϯάͷΈ
✗ ઃఆϑΝΠϧ ύοέʔδ ϛυϧΣΞ 1)1ϥΠϒϥϦ ιʔείʔυ αʔό खಈͰ͍ΖΜͳ ͷ͕ಥͬࠐ· Ε͍ͯΔঢ়ଶ
;Θ͚͢Δ ઃఆϑΝΠϧ ύοέʔδ ϛυϧΣΞ 1)1ϥΠϒϥϦ ιʔείʔυ etc.
ઃఆϑΝΠϧ αʔό ύοέʔδ ϛυϧΣΞ ιʔείʔυ γεςϜ ◦ ߏཧ͕͠ ͔ͬΓ͞Εͯ ͍Δঢ়ଶ
ߏཧΛ࢝ΊΔ
ํ ͍͖ͳΓશ෦ΛཧԼʹ͓͜ ͏ͱ͠ͳ͍ ຊ൪ڥʹద༻͢Δ ࠓಈ͍͍ͯΔຊ൪Λյ͞ͳ͍ Ͱ͖Δͱ͜Ζ͔Βগͮͭ͠
ຊޠͰಡΊΔ། ҰͷPuppetೖ ॻ Ϟμϯ͔࣮ͭફత ͳ༰ ඞಡ
ֶश๏ ຊΛॻ͘ͱΑ͍ ిࢠॻ੶ ࣗͷษڧʹͳΔ पғʹಡΜͰΒͬͯΊ ΒΕΔ ৽ଔΧϦΩϡϥϜͷҰ෦
πʔϧͷಋೖ Puppet, Chef, Ansible... ͲΕΛ͍͍ͬͯ ࣮ࡍʹཧɾӡ༻Ͱ͖͍ͯΔ ͜ͱ͕େࣄ ೖهࣄଟ͍͕ɺͦΕ͚ͩ Ͱ࣮ફ͍͠
࣮ફతಋೖ๏ ·ͣͳʹ͔ͻͱͭͰ͍͍ ͔Β؆୯ͳઃఆϑΝΠϧ͔Β ຊ൪ڥ͔Βίϐʔͯ͘͠Δ ϦϙδτϦʹίϛοτ ͜ͷϑΝΠϧʹ͍ͭͯઈର ʹखಈͰߋ৽͠ͳ͍
࠷ݶॻ͍ͯʜ
ద༻͢Δʂ
Ͱ͖Δ͚ͩ؆୯ʹ Chef Serverͱ͔ puppetmasterͱ͔ͩΔ͍ knife-solocapistranoͰద ༻Ͱ͖ΔΑ͏ʹ͢Δ ࠷ॳʹͦ͏͍͏ΈΛ࡞Δ
։ൃڥ
։ൃڥΛݟ͢ ୭͔͕ߏஙͨ͠ڞ༻αʔό ୭͔͕ߏஙͨ͠VM ୭͔͕ߏஙͨ͠AMI ʮൿͷλϨʯ
։ൃڥͰҭͯΔ εϞʔϧελʔτͰຊ൪ద༻ Ͱ͖ΔΑ͏ʹͳͬͨΒɺ։ൃ ڥͰຊ֨తʹҭ͍ͯͯ͘ յΕͯҰൃͰ࡞ΓͤΔ͜ ͱ͕େࣄ ୭ͰڥߏஙͰ͖ΔΑ͏ʹ
Vagrant Box࡞ͬͯΞϯνύλ ϯ ʮൿͷλϨʯ ΠϝʔδΛ͍·Θ͞ͳ͍ ߏཧπʔϧΛΘͳ͍ Vagrantͷར༻ʹҙຯͳ͠
ίʔυͷஔ
Vagrantfile
DevOps ΞϓϦέʔγϣϯ։ൃऀ PuppetϚχϑΣετΛॻ͘ γεςϜߏ1VQQFUͰɺ PHPϥΠϒϥϦཧ composerͰ
composer PHPϥΠϒϥϦͷཧΞϓ Ϧ։ൃऀͷ αʔόଆͷґଘϚχϑΣε τͰཧ
ϚχϑΣετͷద༻
ຊ൪ڥͷద༻ ࠷ॳߏཧπʔϧ͚ͩͰ ߏஙͰ͖ͳ͍͍ͯ͘ গͮͭ͠ɺద༻ൣғΛ૿͠ ͍ͯ͘→શ෦ ٕज़తෛ࠴Λগ͠ͰݮΒ͢
͜ͷຊʹશ෦ॻ͔ Ε͍ͯ·͢ ඞಡ
PHPͷόʔδϣϯΞοϓ
ݴޠʹؔ͢Δ ݴޠͷมߋʹΑΔ ඇޓͳมߋ ґଘϥΠϒϥϦ͕ඇରԠ ٽ͖ͳ͕Β͢ ಛʹ͍͍ํ๏ͳͲͳ͍
ෳࡶੑΛॖݮ͢Δ mod_php + Apache͔Β PHP-FPM Apacheͱͷີ݁߹ΛΊΔ όʔδϣϯͷΈ߹ΘͤΛݮ Β͢→ߋ৽͘͢͢͠Δ
xbuild
xbuild PHPରԠ͍ͯ͠Δ xbuildΛgit cloneͯ͠ɺ php-installίϚϯυΛୟ͘ ͚ͩ
None
supervisor
֤όʔδϣϯΛ༻ҙ ܥhttp://example.com:5300/ ܥhttp://example.com:5400/ ܥhttp://example.com:5500/
όʔδϣϯͷΓସ͑ ͕Μͬͯݕূ͢Δ ʮ͍͚ΔʂʯͱͳͬͨΒɺϑ ϩϯτͷϦόʔεϓϩΩγͷ ͖ઌΛม͑Δ͚ͩ
·ͱΊ
มԽʹܧଓతʹରԠ͠ଓ͚Δ ͷWebαʔϏεͷ໋॓ ߏཧΛɺখ͍͞ͱ͜Ζ͔ ΒɺޮՌతʹ࢝ΊΔ PHPͦͷͷΑΓγεςϜͷ ෳࡶੑͷํ͕ ܧଓతʹόʔδϣϯΞοϓͰ ͖Δ͜ͱ͕େ