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
実践サーバーレスパフォーマンスチューニング ~その実力に迫る~ / Practical ...
Search
shiro seike
PRO
October 12, 2024
Programming
2
320
実践サーバーレスパフォーマンスチューニング ~その実力に迫る~ / Practical Serverless Performance Tuning ~A Close Look at its Power~
JAWS FESTA 2024 in 広島
https://jawsfesta2024.jaws-ug.jp
shiro seike
PRO
October 12, 2024
Tweet
Share
More Decks by shiro seike
See All by shiro seike
AWS Lambdaから始まった Serverlessの「熱」とキャリアパス / It started with AWS Lambda Serverless “fever” and career path
seike460
PRO
1
260
とにかくAWS GameDay!AWSは世界の共通言語! / Anyway, AWS GameDay! AWS is the world's lingua franca!
seike460
PRO
1
860
PHPを書く理由、PHPを書いていて良い理由 / Reasons to write PHP and why it is good to write PHP
seike460
PRO
5
560
AWS CDKを用いたセキュアなCI/CDパイプラインの構築 / Build a secure CI/CD pipeline using AWS CDK
seike460
PRO
3
700
いまあるチームにフィットさせる Serverless そして Platform Engineeringへの挑戦 / Serverless Fits the Team You Have and Platform Engineering
seike460
PRO
2
1.9k
いまあるチームにフィットさせる Serverless / Serverless fits in with the team you have now.
seike460
PRO
2
170
地方こそサーバーレス! チームにフィットさせるサーバーレス / Rural areas are serverless! Serverless to Fit Your Team
seike460
PRO
1
110
AWS X-Rayを利用したサーバーレスのパフォーマンス分析 / Serverless performance analysis using AWS X-Ray
seike460
PRO
2
170
Cloudflare Workers x AWS Lambdaの組み合わせユースケース / Cloudflare Workers x AWS Lambda Combination Use Case
seike460
PRO
2
500
Other Decks in Programming
See All in Programming
LLM生成文章の精度評価自動化とプロンプトチューニングの効率化について
layerx
PRO
2
190
2024/11/8 関西Kaggler会 2024 #3 / Kaggle Kernel で Gemma 2 × vLLM を動かす。
kohecchi
5
910
AWS IaCの注目アップデート 2024年10月版
konokenj
3
3.3k
「今のプロジェクトいろいろ大変なんですよ、app/services とかもあって……」/After Kaigi on Rails 2024 LT Night
junk0612
5
2.1k
ピラミッド、アイスクリームコーン、SMURF: 自動テストの最適バランスを求めて / Pyramid Ice-Cream-Cone and SMURF
twada
PRO
10
1.3k
ECS Service Connectのこれまでのアップデートと今後のRoadmapを見てみる
tkikuc
2
250
Ethereum_.pdf
nekomatu
0
460
EventSourcingの理想と現実
wenas
6
2.3k
광고 소재 심사 과정에 AI를 도입하여 광고 서비스 생산성 향상시키기
kakao
PRO
0
170
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
110
as(型アサーション)を書く前にできること
marokanatani
9
2.6k
.NET のための通信フレームワーク MagicOnion 入門 / Introduction to MagicOnion
mayuki
1
1.5k
Featured
See All Featured
Optimising Largest Contentful Paint
csswizardry
33
2.9k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.2k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
How To Stay Up To Date on Web Technology
chriscoyier
788
250k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
506
140k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
47
2.1k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
31
2.7k
RailsConf 2023
tenderlove
29
900
Thoughts on Productivity
jonyablonski
67
4.3k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.7k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
Building Adaptive Systems
keathley
38
2.3k
Transcript
©Fusic Co., Ltd.  1 ࣮ફαʔ バ ʔϨε パ ϑΥʔϚϯενϡʔχϯ
グ ~ͦͷ࣮ྗʹഭΔ~ 2024.10.12 @seike460 JAWS FESTA 2024 in ౡ
©Fusic Co., Ltd. 2 ਗ਼Ո ࢙ @seike460 AWS Community Builder
Serverless BacklogWorld2024 ࣮ߦҕһ 12/14@ԣ ίϛϡχςΟ JAWS-UG Fukuoka Serverless Meetup Fukuoka Cloudflare Meetup Fukuoka JBUG Fukuoka JP_Stripes Fukuoka Fukuoka.php Fukuoka.go ࣗݾհ ͡Ίʹ גࣜձࣾFusicʢԬʣ ϓϦϯγύϧΤϯδχΞ/ΤόϯδΣϦετ
©Fusic Co., Ltd. 3 CONTENTS ࣍ 1. αʔόʔϨεͱύϑΥʔϚϯε 2. ϘτϧωοΫͷ୳ࡧͱՄࢹԽ
3. ϘτϧωοΫݪҼͷߟ 4. ϘτϧωοΫͷΞϓϩʔν 5. ·ͱΊ
©Fusic Co., Ltd. 4 αʔόʔϨεͱύϑΥʔϚϯε 1
©Fusic Co., Ltd. 5 αʔόʔϨεͱύϑΥʔϚϯε αʔόʔϨεΞʔΩςΫνϟجຊϚωʔδυαʔϏε͕લఏ - Πϯϑϥཧෆཁ - ࣗಈεέʔϦϯά
ͦͷજࡏೳྗͷߴ͔͞ΒʮͳΜͱͳ͘ʯߏஙͯ͠ ߴ͍ύϑΥʔϚϯε͕ग़Δ͜ͱ͕ଟ͍Ͱ͢ ҰํͰԿߟ͑ͳ͍ͱαʔόʔϨεͷ࣮ྗΛൃش͠Δ͜ͱͰ͖·ͤΜ
©Fusic Co., Ltd. 6 αʔόʔϨεͰύϑΥʔϚϯεΛग़͢ҝʹඞཁͳࣄ αʔόʔϨεΞʔΩςΫνϟجຊతʹߴύϑΥʔϚϯε ͔ͩΒͦ͜গ͠ͷϘτϧωοΫݦࡏԽ͍͢͠ͱ͍͏ಛ͕͋Δ ͰԿΛ͢ΕΑ͍ͷ͔ ʮਖ਼͘͠ঢ়گΛѲͯ͠ɺਖ਼͘͠ରॲΛ͠ଓ͚Δʯࣄʹਚ͖·͢ αʔόʔϨεΞʔΩςΫνϟͷίΞίϯϙʔωϯτͰ͋Δ
AWS LambdaΛத৺ʹύϑΥʔϚϯενϡʔχϯάΛߦͬͯΈ·͠ΐ͏
©Fusic Co., Ltd. 7 The Serverless ArchitectureͳΑ͋͘Δߏ - Amazon API
Gateway - RESTful APIͷΤϯυϙΠϯτΛఏڙ - AWS Lambda - ϏδωεϩδοΫΛ࣮ ࠓճPython - Amazon DynamoDB - σʔλετΞͱͯ͠ར༻ - AWS SAM - Serverless༻ͷIaC
©Fusic Co., Ltd. 8 ࠓճ୯ମͷॲཧվળ ࠓճrpsͰͳͯ͘ ͻͨ͢Β୯ମͷॲཬΛվળ͠·͢ ݁Ռrps࣮֬ʹ্͠·͢ AWS LambdaΛத৺ʹ
ϘτϧωοΫΛ୳ͯ͠ վળΛߦ͍͖ͬͯ·͠ΐ͏
©Fusic Co., Ltd. 9 ϘτϧωοΫͷ୳ࡧͱՄࢹԽ 2
©Fusic Co., Ltd. 10 ϘτϧωοΫͷ୳ٻ(※େલఏɺຊདྷHandlerͱॲཧ͚·͠ΐ͏) ͋Δ͕͍ؔͱใࠂ AWS LambdaͷίʔυΛ ݟͯΈΔͱࠨͷίʔυ͕ ࠨͷίʔυΛύοτݟͰ
ਖ਼͘͠վળ͢Δ͜ͱ ग़དྷ·͔͢ʁ -> NOͩ͠ɺYESͱ͑Δਓ͕ ͍ͯ࠶ݱੑͷͳ͍ݸਓೳྗ
©Fusic Co., Ltd. 11 ࠓԿ͕ى͍ͬͯ͜Δ͔Θ͔Βͳ͍ গ͠ҙਂ͘ݟͯ… - Handlerʹ༷ʑͳॲཧ͕ - Ͳ͔͔͜ΒUserͷใऔಘ͕
- ԿΒN+1͕ - Ͳ͔͜ʹAPIΞΫηεͯ͠Δʁ ͍ॲཧͷதʹ৭ʑͳ͕ ೖ͍ͬͯͦ͏
©Fusic Co., Ltd. 12 AWS X-Ray ΞϓϦέʔγϣϯͷύϑΥʔϚϯεΛ͠ՄࢹԽ͢ΔͨΊͷαʔϏε τϨʔεΛͬͯࢄγεςϜͷϦΫΤετͷྲྀΕΛࢹ֮Խ ಛʹαʔόʔϨεΞʔΩςΫνϟͰ༗༻
©Fusic Co., Ltd. 13 AWS X-Ray ͷΈ - τϨʔγϯάσʔλͷऩू -
࠷ॳʹτϨʔε IDΛੜͯ͠ɺ֤छαʔϏεʹ࿈ܞ - τϨʔεηάϝϯτΛར༻ͯ͠ՄࢹԽ͢Δ - LambdaɺAPI GatewayɺDynamoDB ͳͲͷαʔϏε - ҙͷαϒηάϝϯτͷ֓೦ಋೖՄೳ - τϨʔεͷྲྀΕ - ϦΫΤετ͕ͲͷαʔϏεΛ௨ա͢Δ͔ΛՄࢹԽ Ͳ͜Ͱ͍͔ɺΤϥʔ͕ൃੜ͍ͯ͠ͳ͍͔֬ೝՄೳ
©Fusic Co., Ltd. 14 AWS X-Ray ͷಋೖɿtemplate.yaml AWS SAM Template.yaml
Tracing: Active Λهड़͢Δ τϨʔεID͕ੜ͞ΕΔ Α͏ʹͳΔ
©Fusic Co., Ltd. 15 AWS X-Ray ͷಋೖɿιʔείʔυ requirements.txtΛར༻͠ pip install
ͦͷޙpatch_all()Λ࣮ߦ͢Δ ֤छAWSαʔϏεͷ τϨʔε͕ߦΘΕͯɺ τϨʔεϚοϓ͕࡞͞ΕΔ
©Fusic Co., Ltd. 16 AWS X-Ray τϨʔεϚοϓ ԿΒ༷ʑͳґଘ͕ؔ͋Γͦ͏
©Fusic Co., Ltd. 17 AWS X-Ray τϨʔεϚοϓ ԿΒ༷ʑͳґଘ͕ؔ͋Γͦ͏ - DynamoDB
- S3 - DynamoDB - ֎෦API
©Fusic Co., Ltd. 18 ߋʹιʔείʔυͷϘτϧωοΫΛ͏ segment୯ҐͰͷτϨʔε͕Մೳ xray_recorder.begin_subsegment xray_recorder.end_subsegment Ͱࢦఆൣғͷsubsegment୯Ґͷ࣮ߦ࣌ؒ with
xray_recorder.in_subsegment ࣮ࡍͷॲཬ ͱ͍͏ॻ͖ํՄೳ
©Fusic Co., Ltd. 19 ߋʹιʔείʔυͷϘτϧωοΫΛ͏ segment୯ҐͰͷτϨʔε͕Մೳ xray_recorder.begin_subsegment xray_recorder.end_subsegment Ͱࢦఆൣғͷsubsegment୯Ґͷ࣮ߦ࣌ؒ with
xray_recorder.in_subsegment ࣮ࡍͷॲཬ ͱ͍͏ॻ͖ํՄೳ
©Fusic Co., Ltd. 20 ؔ୯ҐͰͷTraceՄೳ ؔ୯ҐͰTrace͍ͨ͠߹ @xray_recorder.captureΛར༻ ࣮ߦ͕͔͔͍࣌ؒͬͯΔؔͷಛఆ͕Մೳ
©Fusic Co., Ltd. 21 ؔͰͷαϒηάϝϯτઃఆ͕Մೳ ෳࡶ͔ͭߴՃ͕͔͔Δcomplex_logicʹ ॲཧ͕͔͔͍࣌ؒͬͯΔՕॴΛಛఆ͢Δҝɺ Segment୯ҐͰͷऩूΛ࣮ࢪ ※͜ͷؔͷதࣗମChatGPTʹ ʮpandasͱnumpyΛͬͨCPUόϯυͳॲཧʯ
Λੜͯ͠Β͍·ͨ͠ ސ٬ͷϥΠϑλΠϜՁʢCLVʣ ͷγϛϡϨʔγϣϯΒ͍͠ ؔͷதͰ͕͔͔͍࣌ؒͬͯΔϙΠϯτ͕ Ͳ͜ͳͷ͔ͷಛఆ͕ग़དྷΔ
©Fusic Co., Ltd. 22 ؔͰͷαϒηάϝϯτઃఆ͕Մೳ
©Fusic Co., Ltd. 23 AWS X-Ray τϨʔεը໘ શମͰ23ඵͱ͓ੈࣙʹૣ͍ͱݴ͑ͳ͍͜ͱ͕ݟ͑Δ ҰͭҰͭυϦϧμϯ͍͖ͯ͠·͠ΐ͏
©Fusic Co., Ltd. 24 ϘτϧωοΫݪҼͷߟ 3
©Fusic Co., Ltd. 25 Init -> ColdStart initʹ͕͔͔͍࣌ؒͬͯΔࣄ͕Θ͔Δ -> ColdStart͕3ඵͱൺֱత͍ͷͰɺColdStartରࡦ͚ͩͰ͋Δఔվળͦ͠͏
©Fusic Co., Ltd. 26 Ϣʔβʔใͷऔಘ Ϣʔβʔใͷऔಘʹͯɺget_users -> get_user_infoͱ͍͏ DynamoDBʹؔ͢Δσʔλऔಘ͕ൃੜ͍ͯ͠Δ get_usersͱ͍͏ෳͷऔಘͱget_user_infoͱ͍͏ύʔςΟγϣϯΩʔʹରͯ͠
ߦ͍ͦ͏ͳؔͰDynamoDBʹର͢Δ͕ࠩ΄΅ͳ͍͜ͱ͕ؾʹͳΔ
©Fusic Co., Ltd. 27 Ϣʔβʔใͷऔಘ Ϣʔβʔใͷऔಘʹͯɺget_users -> get_user_infoͱ͍͏ DynamoDBʹؔ͢Δσʔλऔಘ͕ൃੜ͍ͯ͠Δ get_usersͱ͍͏ෳͷऔಘͱget_user_infoͱ͍͏ύʔςΟγϣϯΩʔʹରͯ͠
ߦ͍ͦ͏ͳؔͰDynamoDBʹର͢Δ͕ࠩ΄΅ͳ͍͜ͱ͕ؾʹͳΔ
©Fusic Co., Ltd. 28 DynamoDBʹର͢ΔN+1 get_user_info͕܁Γฦ͞Ε͍ͯΔ N+1͕ൃੜ͍ͯ͠Δࣄ͕Θ͔Δ DynamoDBʹܧଓతͳෛՙ͕͔͔Δ͠ ୯७ʹύϑΥʔϚϯεͷӨڹ͕ग़͍ͯΔ
©Fusic Co., Ltd. 29 complex_logicͱ͍͏ෛՙ͕ߴ͍ؔ complex_logicͱ͍͏ෛՙ͕ߴ͍ؔͷதͰɺ ಛʹγϛϡϨʔγϣϯΛߦ͍ͬͯΔ෦ͷෛՙ͕ߴ͍͜ͱ͕ݟ͑Δ ͳ͓͔ͭઌఔ֬ೝͨ࣌͠ʹɺͻͨ͢ΒܭࢉॲཧΛߦ͍ͬͯͨ͜ͱ֬ೝग़དྷͨͷͰ ୯७ʹCPUͷରॲ͔͠ͳͦ͞͏
©Fusic Co., Ltd. 30 վम͕͍͠֎෦APIͷϘτϧωοΫ ֎෦APIΞΫηε͍ͯͯ͠ɺվम͕͍͠ύϑΥʔϚϯεͷϘτϧωοΫ ֬ೝ͕ग़དྷͨ ʢhttpbin.org֤Methodʹର͢ΔϨεϙϯεΛฦͯ͘͠ΕΔαΠτʣ
©Fusic Co., Ltd. 31 શମͷ͕ݟ͑ͯ͘Δ ·ͩશʹΘ͔͍ͬͯͳ͍͕վम͠ͳ͚ΕͳΒͳ͍ର͕ߜΕ͖ͯͨ ࠓճSegment୯ҐͰѲ͠ʹ͍͍ͬͯΔ͕ɺࡶʹpatch_all͢Δ͚ͩͰ༗༻Ͱ͢
©Fusic Co., Ltd. 32 Lambda Insights AWSͷαʔϏεΛར༻͢ΔͳΒ Lambda InsightsҰͭͷखஈ ػೳΛOnʹ͢Δ͚ͩͰ
AWS LambdaͷύϑΥʔϚϯε ʹؔΘΔσʔλͷՄࢹԽ͕ ͘͢͠ͳΓ·͢
©Fusic Co., Ltd. 33 Lambda Insights ύϑΥʔϚϯεΛࣔ࣌ؒ͢ CPUͷ༻࣌ؒϝϞϦͷ༻ྔωοτϫʔΫIO·ͰݟΕΔ ͜͜Ͱେ·͔ͳঢ়گΛ࠷৽1000݅·ͰѲ͢Δ͜ͱ͕Մೳʹ
©Fusic Co., Ltd. 34 Lambda Insights Performanceϩά ColdStart͍ͯ͠Δ͔ɺColdStartͷ࣌ؒͳͲදࣔ ϝϞϦ༻ྔѲͰ͖ΔͷͰ ࣮ࡍͷLambdaͷϝϞϦαΠζΛܾΊΔ࣌ͷ
ඇৗʹࢀߟʹͳΓ·͢ ࠓճϝϞϦ90%Ҏ্͍ͬͯ·͢͠ CPUύϫʔΛ্͍͛ͨͷͰϝϞϦΛ1024MB·Ͱ্͛·͢ ※AWS Lambda ͷCPUϝϞϦґଘ ߋʹ͜ͷιʔείʔυΛཧղ͢ΔͨΊʹѲΛਐΊΔ
©Fusic Co., Ltd. 35 cProfile ιʔείʔυͷதͷϥΠϒϥϦͷதͷॲཧ·Ͱ ੳ͢ΔͨΊʹcProfileͱ͍͏ϥΠϒϥϦΛར༻ cProfile.Profile().enable cProfile.Profile().disable ͷؒͷϓϩάϥϜ࣮ߦΛؔͷ୯ҐͰ
ͯ͢ϓϩϑΝΠϦϯάͯ͘͠ΕΔεάϨϞϊ ※ࠓճPythonͳͷͰcProfile͕ͩ PHPͳΒ Xdebug GoͳΒ pprof JavaScriptͳΒ Profiler API
©Fusic Co., Ltd. 36 cProfile ࠷ऴతʹϓϩϑΝΠϦϯά݁ՌΛऔΓग़͢ ඞཁ͕͋ΔͷͰS3ʹϑΝΠϧอଘ ͦͷϑΝΠϧΛऔಘͯ͠ɺ ϩʔΧϧͷPCͰ࣮ࡍͷղੳΛߦ͏ ※S3ͷputݖݶΛΕͣʹ
©Fusic Co., Ltd. 37 snakeviz औಘͨ͠profϑΝΠϧΛ ՄࢹԽ͢ΔͨΊʹ ʮsnakevizʯΛར༻ profϑΝΠϧΛಡΈࠐ·ͤ ϩʔΧϧαʔόʔΛཱͯΔ
http:://localhost:8080 ࠨͷ༷ͳάϥϑ͕֬ೝՄೳʹ
©Fusic Co., Ltd. 38 snakeviz ؔΛΫϦοΫ͢Δͱ υϯυϯؔʹજΓɺ Ͳ͕͜ݪҼͷؔͳͷ͔ ಛఆ͢Δ͜ͱ͕Մೳ
©Fusic Co., Ltd. 39 snakeviz connectionpool.py͕ ͔ͳΓͷׂ߹ΛΊ͍ͯΔ Կར༻͢Δ෦Ͱ͋Δ͕ ຊདྷଓΛҰߦͬͯɺ ͍ճ࣮͢ʹͳͬͯΔͣ
͔ͯ͠͠connectionpool͕ ਖ਼͑ͯ͘͠ͳ͍ʁ
©Fusic Co., Ltd. 40 snakeviz Call͞Ε͍ͯΔճɺ͔͔͍ͬͯΔؙ࣌ؒΘ͔ΓͳͷͰɺରॲ͕͍͢͠ ͱ͍͑ؔΊͪΌͪ͘Ό͕͋ΔͷͰɺ ਖ਼͜Ε͚ͩͩͱݫ͠͞Λײ͡ΔͨΊɺAWS X-rayͱͷ݁ՌΛΈ߹Θͤͯ ߟ͢Δͷ͕ྑ͍
©Fusic Co., Ltd. 41 ରॲ༰ͷߟ - CPUόϯυͳܭࢉॲཧ͕େ͖͘Өڹ - CPUΛ্͛ΔͨΊʹɺϝϞϦαΠζΛ্͛ΔͱΑͦ͞͏ -
DynamoDBͷσʔλऔಘॲཬࣗମʹ͕͋Γͦ͏ - औಘؔͷॲཬݟ͕͠ඞཁͦ͏ - DynamoDBʹର͢ΔN+1͕ൃੜ͍ͯͦ͠͏ - DynamoDBͷઃܭݟ͠ͰରԠग़དྷͳ͍͔ - ֎෦APIͷΞΫηε͕ͦͷ··͘ͳΔ - ֎෦APIͷରॲग़དྷͳ͍ͷͰඇಉظʹॲཧͰ͖ͳ͍͔ ※ࠓճඇಉظॲཧͯ͠ྑ͍ͷͱ͢Δ
©Fusic Co., Ltd. 42 ࣮ࡍͷରॲΛߦ͍ͬͯ͘ ܭଌͷ݁ՌɺରԠࡦ·Ͱݟ͖͑ͯͨͷͰ࣮ࡍͷॲཧվળΛߦ͍ͬͯ͘
©Fusic Co., Ltd. 43 ϘτϧωοΫͷΞϓϩʔν 4
©Fusic Co., Ltd. 44 ϝϞϦαΠζΞοϓ ·ͣ୯७ʹϝϞϦαΠζΛ্͛ͯΈΔ 128 MB -> 1024MB
߹ΘͤͯArchitecturearm64ʹͨ͠΄͏͕ ૣ͘ͳΓ·͢ CPUόϯυͳcomplex_logic͕ ͔͋Β͞·ʹૣ͘ͳΔͷ͕Θ͔Δ
©Fusic Co., Ltd. 45 ϓϩϏδϣϯυίϯΧϨϯγʔͷద༻ ϓϩϏδϣϯυίϯΧϨϯγʔΛద༻͢Δ͚ͩͰ ίʔϧυελʔτ͕ରॲग़དྷΔ ϥΠϒϥϦΛݮΒ͢ࣄ͕ग़དྷͳ͍࣌ૉʹಋೖ
©Fusic Co., Ltd. 46 ϥΠϒϥϦͷImportͷରࡦΛߦ͍͍ͨ࣌ҎԼͷهࣄ Ҿ༻ɿhttps://qiita.com/_kensh/items/ce620ec5b53c623775ae AWSJ Serverless Specialist @_kensh
ͦΖͦΖΧϯϑΝϨϯεͰຊҰԼ͞ΜͷهࣄΛҾ༻͍ͯ͠ΔஉʹͳΓͦ͏Ͱ͢
©Fusic Co., Ltd. 47 DynamoDBΫϥΠΞϯτͷੜ ίʔυΛΑ͘ݟΔͱ͕ؔݺΕΔͨͼʹ DynamoDBΫϥΠΞϯτ͕ੜ͞Ε͍ͯͨ ͜ΕΛάϩʔόϧείʔϓͰ༧Ί࡞͢ΔࣄͰ ଓΛ͍ճ͢Α͏ʹग़དྷͨ
©Fusic Co., Ltd. 48 DynamoDBઃܭͷݟ͠ N+1ൃੜݪҼςʔϒϧΛUserͱUserInfosʹ͚ RDBͷࢥͰઃܭ͕ߦΘΕ͍͔ͯͨΒ 1ରଟͷؔΛޮతʹѻ͏ͨΊʹ ୯Ұςʔϒϧઃܭʹ͢Δ͜ͱͰN+1ͷղফ͕Մೳ
©Fusic Co., Ltd. 49 SQSʹΑΔඇಉظԽ ֎෦APIରॲ͕͠Α͏͕ͳ͍ͷͰɺ ϦΫΤετ͔ΒΓ͢ࣄͰରԠΛߦ͏ AWS SAMͰSQSΠϕϯτۦಈͷઃఆΛߦͬͯ SQSσʔλΛૹ৴͢Δ͚ͩ
ࢥͬͨΑΓඇಉظԽ؆୯ʹग़དྷΔ
©Fusic Co., Ltd. 50 SQSʹΑΔඇಉظԽ ֎෦API෦ΛSQSͷΩϡʔΠϯάʹมߋ SQSىಈͰผͷLambdaΛىಈ LambdaଆͰ֎෦APIΛݺͼग़͢ࣄͰɺ ֎෦APIґଘ͔Β٫
©Fusic Co., Ltd. 51 ॲཧ༰มߋͤͣͱߴԽ ͻͨ͢Βରॲ͢Δ͜ͱͰ23ඵ -> Λ1.26ඵ·ͰݮΒ͢͜ͱʹޭʢτϨʔε͠ͳ͕Βʣ ͬͯΔ͜ͱେͨ͠༰Ͱͳ͍ͷʹɺ͜͜·Ͱվળ͕ߦ͑Δ
©Fusic Co., Ltd. 52 αʔόʔϨεͰύϑΥʔϚϯενϡʔχϯάͷجຊಉ͡ ϚωʔδυαʔϏεϕʔεͷαʔόʔϨε݁ہΞʔΩςΫνϟ ύϑΥʔϚϯενϡʔχϯάͷجຊಉ͡Ͱ ܭଌɺߟɺ࣮ߦͷαΠΫϧΛճ͢ ͜ͷαΠΫϧΛճͨ݁͠Ռɺજࡏೳྗ͕ߴ͍ՁΛൃشͰ͖Δ
©Fusic Co., Ltd. 53 ·ͱΊ 5
©Fusic Co., Ltd. 54 ·ͱΊ αʔόʔϨεΞʔΩςΫνϟεέʔϧΛલఏͱ͍ͯ͠Δ͕ɺॲཧΛݟ͢͜ͱͰਅͷ࣮ྗΛൃش Point 01 ·ͣঢ়گͷѲ͕େࣄɺAWS X-rayɺLambda
InsightsɺϓϩϑΝΠϥʔΛۦͯ͠ܭଌͱѲ Point 02 ঢ়گͷѲ͕ग़དྷͨΒɺࠓ·ͰͷࣝΛۦͯ͠ҰͭҰ࣮ͭ֬ʹରॲɺܭଌΛ܁Γฦͯ͠վળ Point 03 ܭଌɺߟɺ࣮ߦͷαΠΫϧΛճͯ͠ɺServerlessͷਅͷՁʹ͖ۙͮ·͠ΐ͏ʂ Point 04
©Fusic Co., Ltd. 55 Thank You We are Hiring! https://recruit.fusic.co.jp/
͝ਗ਼ௌ͍͖ͨͩ͋Γ͕ͱ͏͍͟͝·ͨ͠