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
2016/05/16 adtech x scala meetup のLT
Search
Tomohisa Omagari
July 03, 2016
Programming
1
77
2016/05/16 adtech x scala meetup のLT
Tomohisa Omagari
July 03, 2016
Tweet
Share
More Decks by Tomohisa Omagari
See All by Tomohisa Omagari
事業貢献を考えるための技術改善の目標設計と改善実績 / Targeted design of technical improvements to consider business contribution and improvement performance
oomatomo
0
1k
プロダクト開発の貢献をアピールするための目標設計や認知活動 / Goal design and recognition activities to promote product development contributions.
oomatomo
5
1.4k
多様性のあるプロダクトチームを目指した共創の3年間の変化 / Three Years of Co-Creation for Diverse Product Teams Change
oomatomo
1
100
事業貢献を見据えた モダナイゼーションへの挑戦
oomatomo
1
70
UXへの投資と組織変革 ─ ビジネスに貢献するUXチームの飛躍 ─
oomatomo
1
44
Finagleを使った広告配信基盤
oomatomo
0
480
Finagleを使った Perl -> Scalaへの移行
oomatomo
0
1.9k
Other Decks in Programming
See All in Programming
動作確認やテストで漏れがちな観点3選
starfish719
5
580
traP の部内 ISUCON とそれを支えるポータル / PISCON Portal
ikura_hamu
0
230
Terraform で作る Amazon ECS の CI/CD パイプライン
hiyanger
0
110
いりゃあせ、PHPカンファレンス名古屋2025 / Welcome to PHP Conference Nagoya 2025
ttskch
1
230
DMMオンラインサロンアプリのSwift化
hayatan
0
230
[JAWS-UG横浜 #79] re:Invent 2024 の DB アップデートは Multi-Region!
maroon1st
0
120
[Fin-JAWS 第38回 ~re:Invent 2024 金融re:Cap~]FaultInjectionServiceアップデート@pre:Invent2024
shintaro_fukatsu
0
310
ISUCON14公式反省会LT: 社内ISUCONの話
astj
PRO
0
130
2024年のkintone API振り返りと2025年 / kintone API look back in 2024
tasshi
0
160
BEエンジニアがFEの業務をできるようになるまでにやったこと
yoshida_ryushin
0
250
最近のVS Codeで気になるニュース 2025/01
74th
1
220
Azure AI Foundryのご紹介
qt_luigi
1
240
Featured
See All Featured
Java REST API Framework Comparison - PWX 2021
mraible
28
8.3k
4 Signs Your Business is Dying
shpigford
182
22k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.6k
The Cost Of JavaScript in 2023
addyosmani
47
7.3k
jQuery: Nuts, Bolts and Bling
dougneiner
63
7.6k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
6
210
The Illustrated Children's Guide to Kubernetes
chrisshort
48
49k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.1k
Building Your Own Lightsaber
phodgson
104
6.2k
Fireside Chat
paigeccino
34
3.2k
A designer walks into a library…
pauljervisheath
205
24k
Transcript
ͳΔͬͯଟ͍ΑͶʁ
ࣗݾհ େۂஐٱ
͋Δػೳͷ ( D: σΟϨΫλʔɺE:ΤϯδχΞ) ▸ Dʮ͜ͷػೳɺཧը໘͕มߋ͞ΕͨΒߋ৽ͯ͠΄͍͠ɻ ɹɹ͋ͱɺؔ࿈͢Δσʔλมߋͯ͠΄͍͠ɻʯ ▸ Eʮ͜ͷػೳͷߋ৽සɺͲΕ͘Β͍ʹ͠·͢ʁʯ ▸
DʮͳΔͰʯ ▸ E ʮ10͝ͱͰ͍͍Ͱ͔͢ʁʯ ▸ Dʮ͏ʙΜɺͬͱͳΔͰʯ ▸ Eʮ̑ʯ ▸ Dʮ͏ʙΜɺͬͱͳΔͰʯ
͋Δػೳͷ ( D: σΟϨΫλʔɺE:ΤϯδχΞ) ▸ Eʮ̍ʯ ▸ Dʮ͏ʙΜɾɾɾɾʯ ▸ EʮϚδ͔ʯ
͋Δػೳͷ ( D: σΟϨΫλʔɺE:ΤϯδχΞ) ▸ E ʮ30ඵʯ(͏Ͳ͏ʹͰͳΕʣ ▸ Dʮ͓͓͓ʯ ▸
Eʮ10ඵʯ ▸ Dʮʯ ▸ Eʮ1ඵʯ ▸ Dʮ࠷ߴʯ
Θ͔͍ͬͯΔ͜ͱ ▸ όονॲཧͰͦ͠͏ ▸ ΩϡʔॲཧͰΕɺ͍ΖΜͳλΠϛϯάͰॲཧͰ͖ͦ͏ ▸ ॲཧ͕ॏෳ͠ͳ͍Α͏ʹ͢Δ
ઃܭͷΠϝʔδਤ
ઃܭͷΠϝʔδਤ ͜͜ͷ෦Λ࡞Δ
Γ͍ͨ͜ͱ ▸ όονॲཧͰɺݫ͍ͨ͠ΊσʔϞϯԽ͢Δ ▸ ͍͍ײ͡ʹΩϡʔॲཧͷ࣮ߦ࣌ؒΛมߋͰ͖Δ ▸ ΩϡʔॲཧͷछྨΛىಈ࣌ͷίϚϯυͰ ࢦఆͰ͖ΔΑ͏ʹ͍ͨ͠
ͬͨ͜ͱ ແݶϧʔϓ ▸ PerlͰ࣮͍ͯͨ͠Έ͍ͨʹ࣮ ▸ SIGTERMͷΩϟονͯ͠ ແݶϧʔϓΛऴྃͤ͞Δ
݁Ռ ແݶϧʔϓ ▸ ॲཧ͕࣌ʑɺ͖ͪΜͱऴྃͨ͠Γ͠ͳ͔ͬͨΓͨ͠ɻ (SIGTERM ͷνΣοΫ͕͓͔͔ͬͨ͠ͷ͔ɻɻ) ຖճͷ࠶ىಈ͕ා͔ͬͨɻɻ ▸ ࣗͰσʔϞϯͷϓϩηε͕ಈ͍͍ͯΔ͔ νΣοΫ͢Δඞཁ͕͋ͬͨ
▸ ৭ʑͱਏ͔ͬͨ
ͬͨ͜ͱ Play + akka scheduler ▸ PlayͷϞδϡʔϧͱͯ͠ ActorͷॲཧΛ࣮ߦ͢ΔΑ͏ʹͨ͠ ▸ Playͱͯ͠ͷػೳɺಛʹར༻͍ͯ͠ͳ͍
(Controllerͱ͔) ▸ ىಈ࣌ͷҾͰॲཧͷछྨΛมߋ
ͬͨ͜ͱ Play + akka scheduler
ͬͨ͜ͱ Play + akka scheduler ActorΛఀࢭ͢ΔλΠϓɺStopʹ͍ͯ͠Δ ཧ༝ɿϝοηʔδɺ͋͘·ͰॲཧΛ࣮ߦ͢ΔͨΊͷτϦΨʔͱׂͯ͠ PoisonPill Stop
ͬͨ͜ͱ Play + akka scheduler Actorͷઃఆ ɾϝοηʔδ͕ᷓΕͨΒແࢹ͢Δ ɾDead LetterΛແࢹ͢Δ ɾฒྻԽ͠ͳ͍
ͬͨ͜ͱ Play + akka scheduler ManagerActor ɾҾΛݩʹ࣮ߦ͍ͨ͠childActorΛࢦఆ͢Δ ɾchildActor͕ఀࢭ͍ͯΔ͔Ͳ͏͔ͷ ɹεςʔλεΛ͍࣋ͬͯΔ
ɹ(isAliveChildActorͷ෦) ɾManagerActorͷఀࢭΛड͚ͨΒɺ ɹ࣮ߦ͍ͯ͠ΔchildActorΛstop͢Δ ɹTerminatedͨ͠߹ɺεςʔλεΛ ɹfalseʹ͢Δ
ͬͨ͜ͱ Play + akka scheduler Playىಈ࣌ͷManagerActorͷॲཧ
ͬͨ͜ͱ Play + akka scheduler PlayΛఀࢭ͢Δࡍͷॲཧ ɾManagerActorͷఀࢭΛ֬ೝ ͢Δ·Ͱແݶϧʔϓ
ͬͨ͜ͱ Play + akka scheduler ▸ ىಈ࣌ͷίϚϯυ test1ͷॲཧΛ࣮ߦ͍ͨ͠߹ɿ activator run
-Ddaemon-process=test1 test2ͷॲཧΛ࣮ߦ͍ͨ͠߹ɿ activator run -Ddaemon-process=test2
݁Ռ Play + akka scheduler ▸ σʔϞϯԽָ͕ (σʔϞϯͰ໘ͳ෦ΛPlay͕ͬͯ͘ΕΔʣ ▸ Ҿ͝ͱʹ࣮ߦ͍ͨ͠ActorΛબͰ͖Δ
▸ JVMͷOld Memory͕ཷ·Γଓ͚͍ͯΔͷͰɺ ̍Ұճ࠶ىಈ͍ͯ͠·͢ɻ ʢ͍͔͍ͭͨ͠ʣ
Play + akka schedulerΛ͑ɻɻ( D: σΟϨΫλʔɺE:ΤϯδχΞ) ▸ Dʮ͜ͷػೳɺཧը໘͕มߋ͞ΕͨΒߋ৽ͯ͠΄͍͠ʯ ▸ Eʮ͜ͷػೳͷߋ৽සɺͲΕ͘Β͍ʹ͠·͢ʁʯ
▸ DʮͳΔͰʯ ▸ E ʮ͡Όɺ50msͰ͍͍Ͱ͔͢ʁʯ ▸ Dʮ͑ʂʁ͗͢͡ΌͶʁʯ
Έͳ͞ΜɺͲ͏ͬͯ·͔͢ʁ ڭ͍͑ͯͩ͘͞ɻ
ऴΘΓ αϯϓϧίʔυ https://github.com/oomatomo/scala-akka-daemon