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.5k
Other Decks in Technology
See All in Technology
初心者向けAWS Securityの勉強会mini Security-JAWSを9ヶ月ぐらい実施してきての近況
cmusudakeisuke
0
130
アジャイルでの品質の進化 Agile in Motion vol.1/20241118 Hiroyuki Sato
shift_evolve
0
170
安心してください、日本語使えますよ―Ubuntu日本語Remix提供休止に寄せて― 2024-11-17
nobutomurata
1
1k
AWS Media Services 最新サービスアップデート 2024
eijikominami
0
200
Terraform Stacks入門 #HashiTalks
msato
0
360
アジャイルチームがらしさを発揮するための目標づくり / Making the goal and enabling the team
kakehashi
3
140
CDCL による厳密解法を採用した MILP ソルバー
imai448
3
140
20241120_JAWS_東京_ランチタイムLT#17_AWS認定全冠の先へ
tsumita
2
300
AIチャットボット開発への生成AI活用
ryomrt
0
170
DynamoDB でスロットリングが発生したとき/when_throttling_occurs_in_dynamodb_short
emiki
0
250
The Role of Developer Relations in AI Product Success.
giftojabu1
0
140
Why App Signing Matters for Your Android Apps - Android Bangkok Conference 2024
akexorcist
0
130
Featured
See All Featured
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
720
Building Applications with DynamoDB
mza
90
6.1k
BBQ
matthewcrist
85
9.3k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
Building a Scalable Design System with Sketch
lauravandoore
459
33k
Designing for Performance
lara
604
68k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
900
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
42
9.2k
For a Future-Friendly Web
brad_frost
175
9.4k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Agile that works and the tools we love
rasmusluckow
327
21k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
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ͦͷͷΑΓγεςϜͷ ෳࡶੑͷํ͕ ܧଓతʹόʔδϣϯΞοϓͰ ͖Δ͜ͱ͕େ